[jit] Don't force refcount bumps from getTypePtr (#66282)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/66282
Now that a bunch of the `FooType::get()` functions return a const reference, we can forward that behavior through `getTypePtr()` using return type deduction.
Test Plan: Inspect assembly for List_test.cpp before/after the rest of the change; reference counting is no longer in the happy path.
Reviewed By: hlu1, JasonHanwen
Differential Revision: D31486117
fbshipit-source-id: 863b677bb6685452a5b325d327bdc2a0a09627bf