Hi!
As suggested in T43221, wrote string compare functions (BLI_strcasecmp_utf8, BLI_strcasestr_utf8) using Py_UNICODE_TOLOWER within a helper function (BLI_str_utf8_lower_as_unicode_and_size) in order to compare lowercase Unicode characters. Since the Py CAPI is used, these functions are only safely defined (and called) when Python is in the build environment, which meant having to add some ifdef guards and make some changes to the blenlib CMakeLists.txt.
Note that Py_UNICODE_TOLOWER has been deprecated since Python 3.3, but I found no equivalent function exposed by the API.