[ty] Expand class bases when reporting diagnostics (#24695)
## Summary
When computing the explicit bases for a class, we were unpacking starred
tuples in the class bases field; but when reporting diagnostics, we used
slightly different logic, so `StaticMroErrorKind::DuplicateBases` could
end up referencing an index that didn't refer to an actual AST node in
`class.bases()`. In other words, the diagnostic reporting used the bases
directly from the AST, but inference indexed into unpacked tuples.
This PR adds a shared abstraction for unpacking that's used in each
site. It also enables us to support showing annotations for unpacked
tuple literals in our diagnostics, as a bonus.
Closes https://github.com/astral-sh/ty/issues/3290.