This is called a huge number of time every time the module is loaded. The function does a lot of things, which I believe aren't necessary for uxtheme string comparison. The impact on process startup is noticeable, and this saves ~1min on the Gitlab CI test run.
Instead, convert strings to uppercase beforehand in a locale-independent way, and compare with wcscmp.