The typical solution is to have the interpreter call a wrapper program or better yet use RBOC etc.. to remove the need for suid in the first place.
Sudo, ..., group membership, even using udev to emit devices with those permissions automatically etc.. all work.
It is horses for courses though with different costs and benefits, but the number of use cases that require suid is tiny.
If you give me more details I can make some suggestions.
Doing a strace on Nvidia's container toolkit in rootless mode is a wrapper example IIRC.
Note that the popularity of BusyBox and containers is an example where there is an easy to miss serious holes, as all processes have access to proc/pid/self, it is trivial to access entry points that have a large attack surfaces.
I found a copy of the decades old faq I remember the above vulnerability from that covers other situations.
http://www.faqs.org/faqs/unix-faq/faq/part4/section-7.html
I know all the above seem more complicated, but the reality is invoking an interpreter as suid is subject to Rice's theorm, you don't control the run time (semantic) behavior, so avoiding privalage escalation is impossible.
In an executable, to run suid still requires encoding run time behavior into syntactic behavior which is still a non-trivial task. Especially if you don't leverage privilege/capabilities dropping and or selinux/apparmor/etc.
While suid itself isn't dangerous, auditing the executable to make sure it doesn't introduce risks is hard, especially over time.
Note there are other protections that come into play that are difficult to track down, like the gnu linker explicitly nuking the LD_* env vars on suid, attempting to avoid return oriented programming attacks etc.
If you prefer the logic side consider "does halt" from the implicant form of Horn clauses.
(∃)(∃)(q_f,x,y)
The above is derivable from clauses if and only if the machine halts. Which is just HALT in prolog.
Having potential non-finite models is what generalizes to Rice, and extends to partial and even total functions in finite time.
The perfectly implemented code, or typical problem of perfectly modify code in the future, is hard with executables and simply intractable for interpreters.
So what you are asking for, a secure fix simply doesn't exist for suid interpreters. If we could, we would solve HALT.