Writes a deterministic semantic TOML document. Comments/layout are not preserved. A table
inside a table is written under a [header] and a nonempty array of tables under [[header]],
after the table's own key = value lines (an empty table is a bare [header], as in the typed
encoder). A table inside any other array stays inline.
Example: text, error := write_toml(doc.root); defer free(text);
Signature
write_toml :: (
root: *Toml_Value,
options := Toml_Options.{}
) -> (string, Toml_Error)