Depends on the type and language. For example, in Java strings are immutable. Therefore you can’t really write over it.
I'm not sure I see the issue, you just implement a memory-safe string class that manages arbitrary bytes, it's slower but that wasn't the goal.