Hmm sorry I think I confused you, that special case for empty comp str feels awkward.
I prefer v1, but what about with this fixup: https://gitlab.winehq.org/rbernon/wine/-/commits/tmp-7827, so that we send WM_IME_STARTCOMPOSITION message if we're about to send any WM_IME_COMPOSITION message next -even with an empty compstr- and then we send WM_IME_ENDCOMPOSITION if composition string is empty.