13 has no simple alternating rule like 11, but the running remainder technique works for every divisor:
rem = 0
for ch in num:
rem = (rem * 10 + int(ch)) % 13
return rem == 0
Why is this correct? Reading a number left to right is the same as value = value × 10 + digit, and (a × 10 + d) mod k depends only on a mod k. So you never need the full value, just its remainder, which stays below 13.