optimize append_any more (#31895)
* inference: improve sizeof tfunc
Primitive types also always have a sizeof. This is particularly relevant for `Ptr`,
since `elsize` uses `sizeof(Ptr)` to compute the stride.
* apply: unify append_any implementations
Rather than optimize two copies of the same function,
we can just have one version of the function that handles everything.