Closing as Won't Fix: the root cause of XWIKI-25607 is fixed in the Syntax Highlighting extension (WIKIEDITOR-106), shipped through XWIKI-25622, so this safeguard is no longer needed.
The remaining usability gap, the focus staying on the toolbar button after clicking it, will be fixed in the extension instead, by giving the focus back to the editor after inserting the markup. Unlike preventing the default mousedown action, this works for both mouse and keyboard users. It was checked on a local instance with the stock toolbar.
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.