Draft: GString: Support on-stack use

Matthias Clasen requested to merge g-string-on-stack into main

Move the preallocation into the GString struct, and add g_string_init and g_string_clear to enable on-stack use of GString.

Sadly, I had to fix some instances in glib where code was just assuming it can pull string->str out of a GString and use it like a malloced string. This may indicate that this is not a safe enough change to make. Opinions welcome

Merge request reports