That sounds like Haskell's ST monad and yeah, that could work. These are very specific "escape hatches" though and typically people want more.
Amusingly, a friend had Claude write some BrainF*ck the other day. Non-trivial algorithm, and it made working code on the first try.