py_string_similarity works with long strings

Calls exceeding the allowed limit are passed instead through temporary
files.