Register_forward_hook alternative or workaround

As this topic says register_forward_hook function is not implemented in C++ API.
I desperately need to implement this one. This hook in python version allows a function to be called multiple times, but the model to be ‘clean’ at the end of each run for other uses. Is there any way to do?

I would also need this function in the C++ API, however I haven’t found any solution/workaround so far…