The fastest way to check if a move is a winning move in Tic Tac Toe
Yes, you can do this more efficiently.  If you have a board position and the last move made to get to that position, you can check whether the board position is an end state using the following insight:

The previous board position wasn't an end state.  Thus, if the board is an end state, that can only happen because there's a 5-in-a-row that includes the square where the last move occurred.

So, if the last move was in square $s$, check whether there's a 5-in-a-row that includes square $s$.  There are only 4 directions to check (horizontal, vertical, and both diagonals), and you can check each direction efficiently.