There's few Python AC ; it's true.
You need general tricks for speed this one. It's not TETRA related.
You should try speed experiments with SEQ too,
you should let matrix (it is very slow) and rather work with polynomials ; if you know how,
you should use exponentiation by block (k-ary method), if you know how.
But I think you already know some of the tricks as you got yet AC.
There's still a lot.
If you try my 'recursive sequence problems' and got max speed, then at last you will have a great bag of tricks.
It's quite a long work to master them all.
In my MOTO page, there's other problems with similar techniques like SNAKYNUM, NUMPLAY, FLIB, ... (each with some few different ideas to get full speed)
Good luck.