I bet you're correct and we wont be able to use ML models to strip code of its patents the way we use them to strip code of its copyright protection. But I wouldn't have expected the copyright stripping trick to work either, yet here we are.
Such changes can thwart the very suspicion that it's a derived work, and failing that, thwart the proof. In a case where the piece of logic is small, and there are only four ways of writing it, modulo naming, nobody can prove infringement unless they have some hard evidence, like security camera footage of you starting with the original and editing it.
Any bit string can be turned into into any other by a series of small edits that insert or delete a single bit, so any bit string could be suspected of being a derived work of any other.
Copyright infringement that is not provable is not real.
You can disguise borrowed code such that, in the first place, nobody will suspect that it's derived from anything, and even then, they won't have evidence that it's derived.
Changing a few names and superficial organization details, on a large and significant work, will likely not fool anyone.
If it's a small module or just one function, quite probably easily so. You don't even have to understand how the code works; if you just know the paper from where the original author got the code, you can just say you implemented the detailed requirements there and validated it on the available test vectors.
If the code's algorithm is patented, you cannot get around the patent by using different function and variable names and perturbing the code organization.