yes yes! that and also his original scenario was that he dies if he loses to joker and he still dies if he wins because disease will take him down shortly thereafter
the FULL star trek reference, though, is that law faces the kobayashi maru but luffy kirks his way through it because he doesn’t believe in no-win scenarios, just like with robin he does what’s needed to convince law to live and thereby cheats the test in its entirety