Object safety check fixes

- Always consider static methods object-safe since they can never be called through a trait object anyway.  The RFC doesn't mention static methods at all, so I'm assuming this is reasonable behavior.
- Fix issue #18490 as a side-effect since we avoid trying to take an out-of-bounds slice later in the code

Closes #18490

r? @nick29581