Here is a patch. I removed the notes about removing TermValComparator as it is the only way to sort a field that has binary doc values.
Other than that:
- it can now sort missing values last
- you can override the terms and docsWithField that are used for comparison
- you can override the detection for null values. This is typically useful if there is a sentinel value that represents null.
I didn't add support for custom missing values as I'm not sure it is a common need on binary/string content but it is easy to implement on top of this comparator by overriding getDocsWithField to return a Bits.MatchAllBits set and wrap the binary dv returned by getBinaryDocValues.