Disclosure: I'm Adrian Rangel, the founder of MexCheck, which I mention near the end. The first two thirds of this post are plain Python with no dependencies, and you can use them without signing up for anything. All identifiers below are public examples, not real people.
If your company onboards Mexican customers, contractors or suppliers, sooner or later a form asks for an RFC (the SAT tax ID) or a CURP (the national population ID). Payroll needs both, CFDI invoicing needs the RFC, and KYC usually wants the CURP.
A regex copied from somewhere catches some typos, but lets through wrong check digits, impossible dates, and IDs that are well formed but belong to nobody.…