Say that a stack frame only contains total functions: could the maximum stack size be statically determined? Say that you have a program with only total functions, or if that is impossible, consider a subset of the program with only total functions. Is it theoretically possible to statically determine the maximum size of the stack frame at runtime? The language may have other characteristics that are relevant/necessary (such as a specific type system).
No. That would allow you to determine the runtime of any given (recursive) program (assuming it always terminates), but that is not a computable problem.