Remove reallocations/tests during write_str().