I noticed that function leads through all of the platform specific string functions which is all sorts of wrapped up in macros, which are difficult to track down the actual conditions and code that is returning the result of:
My guess is that they are instead relying on the platform code to do its job, though I agree with you that a check at the start could work.
Maybe you could put in a pull request and see if the engine team would want to add it?
Length compare not always 100% accurate.
Strings are character arrays, one character stored as one byte always as i know, so comparig length no matter if it is character array length or byte length can give false result.
For example: Six and Sex are 3 character and 3 byte but not equal
Strcmp also compare char by char if i remember good