Before I go to bed :)
I think probably an acceptable solution is to have another function like get_local_vars_and_values() (we can think of a cooler name) which gives you a copy of the local symbol table which you could then pass on to a function.
ermh, some time ago there was a patch which should introduce $CURRENT, why was it rejected?
As Zeev says it needs to be R/O and there might be issues with it still (references and so on).
I don't like it too much but if there's a decent patch which makes sense it should be OK. I'm not sure it's that easy to do in a decent fashion. Are you sure it's needed? :)
I got into Andrei's situation about half a year ago :) I could have needed this sort of function too, well...
2c
andré