Yes it's to handle nesting.  I'm not sure if this function can be called multiple times in the same request, but if it can, say on parent and child xblocks, then I'd rather not overwrite the parent context when this is called for the child.  If they have different names, then it is smart enough to "push" the child context on top of the stack and it's keys will override the parent context, however, when the child context is exited, the parent values will still be there.

If, however, this function is only called once per request, then it should be safe to use the same name.

At a minimum I should probably put in a comment to this effect since it's non-obvious.