Doing that seems like it's just manually replicating a call stack (with potential for error); I don't see what the benefit is. Making functions independent of global state - and allocation is a huge source of implicit dependency on global state - is generally considered good programming practice.