The microsoft demangler makes copies of the demangled strings, but has some confusion between StringView representation (sans NUL), and C-strings (with NUL). Here we also have a use of strcpy, which happens to work because the incoming string view happens to have a trailing NUL. But a simple memcpy excluding the NUL is sufficient.
This is broken out of D120990 and is a prerequisite of that patch.