Rename to_str to to_string

Closes #15796.

[breaking-change]