Avoid un-necessary decode in startsWith/endsWith

As requested in #2503.

Perhaps it's overkill?
But then you have another inconsistency: `startsWith(haystack, needle[0])` is not the same as `startsWith(haystack, needle[0..1])`.