In all examples that use some kind of buffering I see they use stream instead of string. How is std::ostringstream and << operator different than using string.append.
If you concern about speed you should profile and/or test. In theory std::string::append should be not slower as it is simpler (stream has to deal with locale, different formatting and be more generic). But how faster one solution or another really is you can realize only by testing.