Add a lint for usages of to_string().

This is a rebase of #4366.