Why not simply use MAP_JIT?
There is no need to do these weird tricks, plus you’re putting your process and the rest of the system at risk by elevating privilege and using task-for-pid.
There’s just so much software out there and so many little bits of information one can gather.
The debugger entitlement is even more powerful, but once again since you’re modifying your own memory you don’t need it.
What about evolutionary/genetic programming? That can definitely take advantage of this as well.
You also wouldn't need the entitlement anymore.