This implements case mapping for most relatively common Latin, Greek, and Cyrillic characters, including all of those that can be produced by conversion from Mac OS Roman.
For characters within the Mac OS Roman character set, this case mapping seems to match what is expected by Windows 11, as far as I can determine from testing. [MS-NLMP] just says the username is converted to uppercase without giving specifics, so it is possible that other implementations might implement slightly different mappings for certain Unicode characters.
This ensures we will not overflow a fixed buffer. It also zeros out the buffer, which ensures we will never inappropriately include portions of a previous message in it.
This now works with Samba, enabling guest access by just leaving the username and password blank. I have not gotten it to work with Windows--modern Windows seems to block this by default as a security measure.