Thanks, much clearer now what is happening.
Still my argument stands, a bazillion code snippets to free the same single memory location is (at least from the perspective of the script writer) a memory leak. The questions is only if it is advisable to fix it since the fix would probably incur a heavy runtime cost.
It will only affect long running polling code in a few specific cases (for example microcontroller scripts to measure environmental stuff could fall into the trap). It is avoidable but the program writer would need to know information about an implementation detail of "my" that is not in the man pages at the moment.