Edit unicode text in large files using Python