Wouldn't it be better to turn this MSVC-RT "feature" off by default (i.e. with the correct define in CMakeLists.txt)? libgit2 has to ensure that things like buffer overruns don't happen anyway - and that's not depending on being built on Windows.