stdwriter: improve perf by avoiding buffer growth

This PR modifies stdwriter to avoid growing the buffer. A lot of memory was being allocated by this line of code:
```
buf = append(w.prefix[:], buf...)
```