When searching for keyframes inside Python Expression on parameter, it cookes wayyyy too many times (I assume because of recursive evaluation?). So basically, parm.keyframes() or parm.eval(), or anything like that and it gets cooked at least like 300 times.
Because of that it pretty hard to do more complex stuff, for example, custom interpolation functions.
Is there any alternative way to do that, or maybe cook only once or twice, not >300?