iirc – Carnivore has the perfect build for this situation.
Gestalt Ranger 1 with the Trapfinder racial sub / the Sandwich does nothing build 19 on one side. On the other side Tleilaxu_Ghola’s Dirty Trick #5 save game build 20.
This gets everything.
Find the Trap … do almost nothing … until the Reset happens
+20 BAB and 9th level spells