The main problem lies in two things. First, during the UpdateUI handler, menu items and other controls are enabled/disabled and this fires off new UpdateUI messages. Second, wxWidgets sends messages to many objects that aren't updated at all, but just happen to be a child of the same window... for example the editor is notified if you move the mouse over the menu bar or over the project manager.
I'm not sure whether it would work to only listen to the events using one single handler. In any case that would mean to rely on a misfeature (which may be implemented differently on another platform or in another version).
Setting a flag to not process the events won't do much. Our message processing is not what eats up the CPU time, it is pushing a several thousand events through the message queue. wxWidgets will still send them, even if we ignore them.
Using a timer and poll events every 100 ms or so would be great, but unluckily I don't see a way how you can do that with wxWidgets. For all I know there are no functions to actually manipulate the event queue in such a way as we would need (peek at and pop off one message, then remove all duplicates).
A solution that would work would be to move the control updating code to a manager that keeps track of and handles the states of all controls, but that would require an awful lot of work in the present design. Knowing that this design will be replaced one not-so-far day in the future, I'm reluctant to do that work, too.