cpp: Some small optimizations

- Changed + to append in string so we're not constructing new strings
  every time
- Changed to single threaded buffer