The patent system actively discourages this by tripling damages for knowing violation, as does the copyright system by the threat of accusations of copying that are best defended against by 'I never saw it'. It's much safer, legally speaking, to explicitly avoid doing this.
Open source licensing protects direct copying. It does NOT protect re-implementing from scratch. See all the lawsuits around Java. You should not be using open source software if you don't want others to read your source!
Maybe 5 years ago that would be the expectation but all etiquette has been thrown out the window with AI. I think you expect too much.