Hm, this implementation seems allergic to passing types by value, which eliminates half of the allocations. It also makes the mistake of being mutable-first, and provides some fundamentally-inefficient operations.
The main mistake that this makes in common with most string implementations make is to only provide a single type, rather than a series of mostly-compatible types that can be used generically in common contexts, but which differ in ways that sometimes matter. Ownership, lifetime, representation, etc.
How would you recommend doing that sort of "subtyping"? _Generic and macros?
> It also makes the mistake of being mutable-first
Is mutability not part of the point of having a string buffer? Wouldn't the corresponding immutable type just be a string?