centralize our bytes check (#4622)

this will make life a bit easier when we support bytearrays
17 files changed