Why do you think you cant create and pass local objects and arrays? I use them all the time

function foo()
{
var my_local_array[10];
foo2(my_local_array);

ENTITY* my_local_ent = ent_create(.....);
foo3(my_local_ent);
...
}