What do you mean outside of programmer control? What's stopping you from setting the stack size in the linker flags?
ulimit only affects the main program stack though. if you are using multi-threading then there is a per-thread stack limit, which you can configure with pthreads, but not until C++23 for std::thread.