Optimise string handling in ansible.utils._clean_data

As discussed in #8511, [here is the benchmarking info](https://gist.github.com/leth/1f2ba2d6b961fabe5d60).