Adding @ghalliday's review comment from closed pull request (due to re-targeting to 4.2.2):
---
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.