I never ran into this problem either and I'm not sure this is helpful, but I'll try anyway..
If the functions.php file is something you do not control, then you obviously can't rely on someone else excluding globals no matter how you implement the function. In that case, maybe you could (and should?) unset your session state before calling out to those functions and then restore the session state afterwards.
If you do control functions.php and the entire application, it's really a good idea to limit the use of global variables as much as possible. What's the expression? Motherhood and apple pie? Not helpful, I know. Sorry.

Maybe you could take the same approach and save your session state, unset, call the functions.php functions, and then restore state.