Try using GC_generic_malloc_many to allocate multiple objects at once.
float-preallocation
1deff(x): 2defg(y,x=x): 3while1: 4defh(z,x=x,y=y): 5returnx,y,z,a 6a=4# not available for h, available in Python 7returnh 8returng 9 10result=f(1)(2)(3) 11assertresult==(1,2,3,4)