@mathias Thanks a lot for the explanation, my curiosity is satisfied. :>
I'll ask a friend who uses emacs with polish diacritics how he works with that. Don't expect much though, the most popular polish keyboard layout is just the US one with AltGr added, so the problem might be much less severe.