Text from forms, spreadsheets and web pages is rarely clean. A few tools fix most of it.
" ".join(s.split()) collapses every run of spaces, tabs, newlines and non-breaking spaces (\xa0, common in text pasted from web pages) into single spaces, and trims the ends.
.casefold() is .lower() made for comparisons: use it on both sides when case shouldn't matter.
s.translate(str.maketrans("", "", string.punctuation)) deletes every punctuation mark in one pass.
unicodedata.normalize("NFKD", s) splits é into e plus an accent mark; dropping the marks gives plain letters, so "José" and "Jose" match.
.zfill(5) pads a code with leading zeros, .startswith(("A", "B")) takes a tuple, and .partition(":") splits once into (before, separator, after).
Clean a copy into a new variable or column, and keep the original: you may need it to explain a change later.