Borrowed from https://github.com/cloudwego/sonic-rs/blob/v0.5.5/src/util/string.rs
Only takes the string escaping part to avoid the abstraction overhead.