strings: reimplement to_snake_case with a correct semantic