Epanding @G. Sassatelli's remark: The symbol $\pi_1(X)$ is shorthand for "a group isomorphic to $\pi_1(X, x_0)$ for any $x_0 \in X$, where $X$ is path connected so that all these groups are in fact isomorphic."
So path connectedness is really being used in making the statement of the theorem make sense.
You might look at $X = \{P\} \cup S^1$, and $Y = S^1$. The product of $X$ and $Y$ has two components -- a circle and a torus -- and it matters which one you work with.
An alternative formulation of the theorem would be something like this:
"For spaces $X'$ and $Y'$ containing points $x_0$ and $y_0$, let $X$ and $Y$ be the path-components containing $x_0$ and $y_0$ respectively. Then $\pi_1(X \times Y) = \pi_1(X) \times \pi_1(Y)$, and indeed, $\pi_1(X' \times Y', (x_0, y_0)) = \pi_1(X, x_0) \times \pi_1 (Y, y_0)$, but this latter equality is seldom useful in practice, as it ignores all other components of the product space."