That PR uncovered countless issues on `my_snprintf` uses. This commit backports a squashed subset of their fixes.