You can do so with SELinux btw. You can remove the right for a program to run the exec syscall.
It's just sad that there is no really good tutorial how to write your own SELinux modules for your own applications. It's easier than it seems and allows some really powerful security measures.
Maybe you could write one? I bet that it would be really appreciated.
I suspect that these languages just end up deferring to the system() library function in libc. LD_PRELOAD or other linker trick would then let you override it with a do-nothing or complain-loudly replacement.
Shower thought: Allow me to globally disable system() in for language x. Aside from the obvious case of just banning these insane system calls, you're protected against surprise vectors in parsers.
Edit: You would presumably mitigate pipe open vulnerabilities too