Welcome to the murky reign of "intellectual property rights". The idea behind "intellectual property" is that making use of anybody else's ideas against their wishes is not legal.
This idea is very much promulgated and infects to some degree courts and juries. Regardless of the factual legality, there may be costs associated with having to defend against the preconceptions.
So let's look at the actual legalities involved: against copying ideas, the legal protection mechanism are patents. There is no "cleanroom" protection against patents: coming up independently with the same idea or mechanism still requires you to pay royalties for any infringed patent.
In the U.S., an astonishing number of trivial ideas might be patent protected. If you are following an existing sample implementation and the person in question is likely to be an entity who has worked from specs in a patent or has patented stuff himself, you are more likely to tread on troublesome ground than if you just do something yourself. Simply because currently any random idea is more likely to not be covered by a patent than otherwise, and since patent protection runs out after a comparatively short time, that may even stay so for a while. Code may also be put out under a permissive license in order to trap you into using it. When it doesn't have an explicit patent grant, its author can still sue you for patent infringement. So patents may be a danger if the code is an intentional or accidental trap, but the copyright license it is under, unless specifically also covering patents, is not relevant.
Which gets us to the next possible problem: copyright. A tangible expression of an idea (rather than the idea itself) can be covered by copyright. This includes "transformative use" of copyrighted material such as the mechanical or manual translation into a different language or realm.
There have been very murky and very expensive court cases about transformative use trying to prove "structure, sequence, and organization" of APIs are sufficient for triggering copyright claims. Defense against such claims is uncertain and potential legal costs can be high. Regardless of the actual soundness of the underlying legal theories, you want to avoid getting dragged in a case of that kind since it can bankrupt companies let alone individuals.
Particularly so when talking about jurisdiction with juries where the "intellectual property" myth, due to a barrage of propaganda from corporations interested in perpetuating it, has taken enough of a hold in the mind of the populace that they are going to make rulings in accord with it even when none of the actually valid, limited rights for state-protected exclusive exploitation of some idea is really applicable to the case in question.