Yes, you can manually reallocate the data field. Just make sure that you set the dataSize member to the new size.
However, in your case I would suggest directly creating Python objects within your modifier plugin. For example, if you wanted to make some raw byte data available to your script, you could do the following:
Code:
PyObject *imageData = PyString_FromStringAndSize(buffer,bufferLen);
//Add python object to __main__ module
PyModule_AddObject(PyImport_AddModule("__main__"),"myImageData",imageData);
After this code is executed, there will be an
myImageData variable available in the
__main__ scope of your script.