The expectation isn't for it to generate BOM in the output, but to handle BOM gracefully when it occurs in the input.
https://docs.python.org/3/library/codecs.html
The codec you're imagining would also make reading a file and writing it back change the file if it contains a BOM.