you can use ctypes.pythonapi.PyFrame_LocalsToFast to update them since you otherwise can't.
See my answer in this post, in particular, the scope class is what you're wanting: Where is nonlocals()?