This is the reason for making `buf` a pointer, right?  `OutBuffer` is just a struct, so if you do this:
```
OutBuffer oldbuf = buf;
memset(&buf, 0, sizeof(buf));
...
const char *ret = buf->extractData();
oldbuf = save;
save.data = NULL;
```
then we can avoid heap-allocating buffer in the first place.

I'd prefer a solution that made a new mangler but passed along the `saved_idents` or whatever it is we're using instead if possible.