[__init__] Use write_string instead of compat_string (Closes #9689)