Libraries can be (and some actually are) designed with that in mind, with COW (copy on write( types that can be either borrowed or owned. Speaking of performance, kstring (of liquid) goes one step further with inline variants for short strings.
I want to say that seems like a valid concern but in practice I've seen it come up only rarely.
I want to say that seems like a valid concern but in practice I've seen it come up only rarely.