Consumes the wrapper and returns a Python string.
        Afterwards is not necessary to destruct it as it has already
        been consumed.

def to_str(self):
        """Consumes the wrapper and returns a Python string.
        Afterwards is not necessary to destruct it as it has already
        been consumed."""
        val = c_backend.pystring_get_str(self._ptr)
        delattr(self, '_ptr')
        setattr(self, 'to_str', _dangling_pointer)
        return val.decode("utf-8")