This is avoidable if you use Ctrl-C instead of escape. It works identical to [esc] in all ways except one (the InsertLeave autocommand will not be triggered). If you remap Caps lock to Ctrl, you even get a more ergonomic way of escape, since you don't need to move your hand the way you would to press [esc].