I'm not sure I would have made it const, since it is logically getting access to modify something.

I wonder if we should restructure this interface for 5.0 - having ICodeContext for function accessible from code, and ICodeContextEx for plugin functions - to separate functions that are safe to change within a release from those outside.  Probably overkill.