The rest of the standard library uses `~str` because `StrBuf` never existed. If this case had a choice between `~str` and `StrBuf` without requiring a conversion between them, then I wouldn't have mentioned anything.

However, at the moment it's going to great lengths to avoid simply returning the `StdBuf` that's inside the function. It's hurting performance in the caller and it's adding unnecessary unsafety.