Better protection for string conversion functions with undefined / non-string arguments