I don't care much for the argument that %O is only intended for debug purposes, as long as there is no equally succinct way of producing the
From the sprintf() documentation:
*! @value 'O' *! Any value, debug style. Do not rely on the exact formatting; *! how the result looks can vary depending on locale, phase of *! the moon or anything else the _sprintf method implementor *! wanted for debugging.
kind of quoted strings for log files, consumption of other languages and the like you typically want quoted strings for in the first place; the functionality ought to be somewhere (not necessarily sprintf %O, even though I would personally find that awfully convenient), and it should be terse.
Same source:
*! @value 'q' *! Quoted string. Escapes all control and non-8-bit characters, *! as well as the quote characters @tt{'\'@} and @tt{'"'@}.