SV *tmp = sv_2mortal(newSVsv(foo)); do_something(tmp); /* no clean up code required here */