std::print/std::vprint* is currently defined in terms of formatting into a temporary string, e.g. [print.fun]:
void vprint_nonunicode(FILE* stream, string_view fmt, format_args args);Preconditions: stream is a valid pointer to an output C stream.
Effects: Writes the result of vformat(fmt, args) to stream.
Throws: Any exception thrown by the call to vformat ([format.err.report]). system_error if writing to stream fails. May throw bad_alloc.
This is done to make it clear that noninterleaved output is desired while keeping specification simple and portable.
Unfortunately, the current specification seems to prohibit a more efficient implementation that performs formatting directly into a stream buffer under a lock (flockfile/funlockfile in POSIX) like printf does. The difference can be observable in case of an I/O error that occurs before a custom formatter is called. In the (double buffered) implementation that directly follows the spec all formatters will be called, while in a more efficient (locking) implementation subsequent formatters may not be called.
The easiest fix, given in the current proposed resolution, is to say that some arguments may not be formatted in case of a write error. It might be a bit weird considering that the spec says that we construct a string first so an alternative resolution is to replace vformat with vformat_to info some unspecified buffer iterator and state noninterleaving requirement separately.