This would be a little cleaner as `if first_line.startswith(codecs.BOM_UTF8):`