Add a nice append-only stringbuffer, and refactor code to use it
Right now we have 2.5 strategies for building strings out of pieces:
1a) Sometimes, we use a stack-allocated buffer, and a pointer into that buffer, and we write into that buffer using tor_snprintf and strlcpy and friends.
1b) Sometimes we do the same with a heap-allocated buffer.
- Sometimes we allocate a smartlist full of little strings, and use smartlist_join_strings() to turn it into one big string.
Both of these methods are cumbersome and at least somewhat inefficient. It would be better to have something that managed the buffer size, and supported commands like "extend with snprintf" or "extend with string".
Calling this "intro" because it doesn't require extensive knowledge of Tor; but it isn't a small task to do it right. This is something where we'd want to optimize for efficiency... though in the short run, we might just do it as a wrapper around smartlist_t and smartlist_join_strings().