CPython では、これは次のように機能します。
import ctypes
ctypes.pythonapi.PyString_AsString.argtypes = (ctypes.c_void_p,)
ctypes.pythonapi.PyString_AsString.restype = ctypes.POINTER(ctypes.c_char)
s = "abc"
cs = ctypes.pythonapi.PyString_AsString(id(s))
cs[0] = "x"
print s # will print 'xbc'
PyPy では、この方法で C-API にアクセスできないため、そうではありません。
PyPyで同じことをする方法はありますか?