move "func_num_args()" out of a loop