What is wrong with simply initializing the variable? I guess the question is when and how. Unforutnately ACS, and now OpenACS decided to hog the first preauth filter position with the rp_filter (now rp_resource_filter). It would be nice to move both filters to the postauth position, after authorization takes place, although the resource filter could maybe run in preauth, since it doesn't require auth.
Then packages could run initilization code in preauth, and use trace filters to handle cleanup. You might also have the opportunity to load new packages which protect the site and that should run before database access gets involved (possibly aborting the connection). Right now the only way to do this is to hack in a filter into the private init.tcl file.