https://github.com/golang/go/issues/69887
Java has the same mechanism, the -javaagent flag. It has exactly the same drawbacks you mention.