fix bounds checking failure message

casting the `uint` to an `int` can result in printing high values as
negative intege
fix overflow on bounds checks

Closes #9020
use element count in slices, not size in bytes

This allows the indexing bounds check or other comparisons against an
element length to avoid a multiplication by the size.