Zig appears to have a proposed solution to this similar to your option 1, move recursion to the heap.
https://github.com/ziglang/zig/issues/1639
They're also looking at static analysis of the maximum stack depth which might help in some cases.
https://github.com/ziglang/zig/issues/1639
They're also looking at static analysis of the maximum stack depth which might help in some cases.