[Truffle] Handle the case where 'to_str' returns something other than a RubyString.