Provide python-defined callback as argument to RNA-defined function

Hello,

I am experimenting with blender source code modification and I want to set a python callback returning a dictionnary-like structure and pass it to my RNA-defined function as argument (the callback, not the dictionnary).

So whenever I need to get the updated data I call that callback (which I previously stored somewhere) from c++ and traverse the dictionnary.

The data is not intended to be saved inside the blend-file.

Is it possible without breaking blender API ? Is there any clean way to do something like this ?

Thank you