to_string optimizations