newinterp: add external cache mode (#54074)
When working on debugging inference behavior or performance tuning,
having direct access to inspect the global cache can be really handy.
Right now, `@newinterp` utilizes the `Core.Compiler.InternalCodeCache`
for its global caching, which doesn’t allow for such inspections. This
commit introduces the `@newinterp NewInterp cache_externally=true`
option. This enhancement allows `NewInterp` to store `CodeInstance` in
an external cache whose type is `IdDict{MethodInstance, CodeInstance}`.