Artifacts: Improve type-stability (#55707)
This improves Artifacts.jl to make `artifact"..."` fully type-stable, so
that it can be used with `--trim`.
This is a requirement for JLL support w/ trimmed executables.
Dependent on https://github.com/JuliaLang/julia/pull/55016
---------
Co-authored-by: Gabriel Baraldi <baraldigabriel@gmail.com>