struct and few functions and you get there. Look at zig's std lib. "String" type is also IMO anti-pattern
https://mortoray.com/the-string-type-is-broken/People often complain about null terminated "strings" in C, but I don't really see them as a problem. It rarely is performance bottleneck, and when it is you can opt for your own "string type". There is also bstring that's compatible with these strings but prepend header to the data which contains the length. That said I wish C had language level slicing.