make printf-like functions lazy (with a small code duplication cost, and a change in signatures)