It seems that you are mixing mingw (your toolchain setup) and msvc (how hashlib is built). This should be avoided at almost all cost if possible on Windows, even the latest versions.
As you do not seem to have access to the source code, if you cannot get the vendor to supply a mingw version, you either better drop mingw for your project, or hashlib as a dependency.