Use a dictionary to map the values at these 20 positions to the list of strings that match those values at those positions.
Building a dict of lists is a very classical idiom in python:
d1 = {}
for s in list_1:
d1.setdefault(s[12:32], []).append(s)
d2 = {}
for s in list_2:
d2.setdefault(s[12:32], []).append(s)
Then you can find your pairs by iterating on the keys that are in both dictionaries; i.e., keys that are in the intersection of the two sets of keys.
list_w = [
(s1, s2)
for k in set(d1.keys()).intersection(d2.keys())
for s1 in d1[k] for s2 in d2[k]
]
Testing:
list_1 = ['abcdefghijklmnopqrstuvwxyzabcdef', 'aaaaaaaaaaaamnopqrstuvwxyzabcdef', 'aaaaaaaaaaaabbbbbbbbbbbbbbbbbbbb']
list_2 = ['ABCDEFGHIJKLmnopqrstuvwxyzabcdef', 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb']
...
print(d1)
# {'mnopqrstuvwxyzabcdef': ['abcdefghijklmnopqrstuvwxyzabcdef',
# 'aaaaaaaaaaaamnopqrstuvwxyzabcdef'],
# 'bbbbbbbbbbbbbbbbbbbb': ['aaaaaaaaaaaabbbbbbbbbbbbbbbbbbbb']}
print(d2)
# {'mnopqrstuvwxyzabcdef': ['ABCDEFGHIJKLmnopqrstuvwxyzabcdef'],
# 'bbbbbbbbbbbbbbbbbbbb': ['bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb']}
print(list_w)
# [('aaaaaaaaaaaabbbbbbbbbbbbbbbbbbbb', 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'),
# ('abcdefghijklmnopqrstuvwxyzabcdef', 'ABCDEFGHIJKLmnopqrstuvwxyzabcdef'),
# ('aaaaaaaaaaaamnopqrstuvwxyzabcdef', 'ABCDEFGHIJKLmnopqrstuvwxyzabcdef')]