improve nongeneric methods of `Base.rest` (#59549)
Allow non-`Int` in dispatch for the second argument (iteration state),
but `typeassert` `Int` in the method body. This improves abstract
inference because the compiler can know the second argument must be
`Int` to avoid a throw, when previously such a call would have
dispatched to the generic method.