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

Second commit removes now-redundant c_str()s. This commit has a much larger diff and is optional. It's just a cleanup.