Make byte-order mark checks more pythonic

Implement improvements suggested by @acdha