`let mut out = std::str::with_capacity(self.len())` makes this one allocation instead of two, same in `to_upper_default`.