The PS code right now writes to a buffer, and is using IOStream primitives. Could we switch it to string and use std::format?