remove some legacy Py2.[45] code
make encoding detection code a bit faster if the first two source file lines are longer than 250 bytes