gf: cache cache_with_orig decision (#48833)
Memoizing this can save a lot of repeated effort for queries such as
`@which eltype(String)`. Otherwise we repeatedly try to check if
`eltype(::Type)` is a good way to cache that result, even though it
never gets better the more we check it.