Improve partial inference of key container operations (#37084)
`resize!` and `sizehint!` are big targets for invalidation, and quite
a lot of code was calling these methods with poor inference about the
size. Since the size is just `Int`, asserting that eliminates numerous
vulnerabilities. Likewise, bounds-checking always works with `Bool`.
Finally, add a couple of short-circuits for `eltype(::Tuple{T,...})`,
including one that bypasses `typejoin`.