The behavior of the function changed at some point. I have written a quick&dirty test to demonstrate that ([0001-test.txt](/uploads/982da21ccf01cb089d613f184fd82faa/0001-test.txt)). It shows, that mbstowcs should be used in msvcp90. On the other hand it shouldn't be used in msvcp140. It will be needed to limit the change to only some versions of msvcpXX.
It would be also nice to add some tests.