This doc page says
When the WM_GETTEXTLENGTH message is sent, the DefWindowProc function returns the length, in characters, of the text. Under certain conditions, the DefWindowProc function returns a value that is larger than the actual length of the text. This occurs with certain mixtures of ANSI and Unicode, and is due to the system allowing for the possible existence of double-byte character set (DBCS) characters within the text.
I assume none of these conditions can occur in a WCHAR edit control, since it's WCHAR only.
I feel like just ignoring them and using WM_GETTEXTLENGTH directly as my length. If it happens that WM_GETTEXTLENGTH doesn't just do a strlen operation to get its value, and instead has it precomputed, that would be good for performance. I guess I will have to look at the decompilation of notepad in ghidra to find out.