Use type-safe formatting for strprintf and logging

Switch to tinyformat-based formatting. Alternative to #3271.

Tinyformat is a typesafe drop-in replacement for C99 printf functions: https://github.com/c42f/tinyformat

Removes need for real_strprintf and other macro hacks. Also removes the need for the -D__USE_MINGW_ANSI_STDIO hack for mingw.

Second commit removes now-redundant c_str()s as the new formatting function can take std::strings directly. This commit has a much larger diff and is optional. It's just a cleanup.

Edit: should also fix "gnu_printf" warnings when building for MacOSX