A polynomial $P$ is of the form $\pm x^6 \pm x^5 \pm x^4 \pm x^3 \pm x^2 \pm x \pm 1$. Given that $P(2) = 27$, what is $P(3)$?

Let's think step by step and output the final answer within \boxed{}.
user