This philosophy of appending to an IO instead of returning an intermediate string results in better performance than handling intermediate strings.
EDIT: You can however still override def to_s : String instead of the IO version. This can be useful if you already have the string representation in memory (such as within an ivar) to save some additional memory.