Vectors fixed under compact subgroup Let $G=SL(2,\mathbb{R})$ and let $K=SO(2)$ be our maximal compact subgroup. Let $(\pi,V)$ be a real irreducible representation of dimension $d$. 
Apparently one has that the set of $K$-fixed vectors $V^K$ is $1$-dimensional if and only if $d$ is even. In the other case, the dimension of $V^K$ is $0$.
Why is this the case?
 A: Identify - as was done in the comments - the representation with the space of homogeneous polynomials in two variables $X$ and $Y$ of degree $d$ - please see remark 4 at the end of this answer. For neatness, I am not writing $\pi$ explicitly in the representation - i.e. write $g v= \pi (g) v$.
The eigen-spaces (weight-spaces) for the diagonal matrices $d(t)={\rm diag} ( t, t^{-1}$) are one-dimensional, each spanned by a monomial, i.e. by $X^{d-k}Y^k$:
$$ d(t)    X^{d-k}Y^k = (tX)^{d-k}(t^{-1}Y)^k = t^{d-2k}X^{d-k}Y^k,$$
with weights (eigenvalues) $t^{d-2k}$. 
(This is correct up to multiplicative inverse - i.e., I am writing $d(t) f (X,Y)= f(tX,t^{-1}Y)$, but probably I should replace $t$ with $t^{-1}$.) 
In any case,  $d-2k=0$ appears in the representation iff $d$ is even.
The Lie algebra also acts on the representation by differentiation, and  $$H= d/dt|_{t=1} d(t) = {\rm diag} (1,-1)$$ has the same eigen-spaces (weight-spaces) as $d(t)$, with eigen-values $d -2k$. 
One can go back to the Lie group by exponentiation i.e. $ d(e^t)= \exp ( t H)$.
Write 
$$ r(\theta) = \left( \begin {array}{cc}\cos\theta&-\sin \theta \\ \sin \theta  &\cos \theta \end{array}\right),$$
and
$$ R = \left. {d\over d \theta}\right|_{\theta=0} r(\theta) =\left( \begin {array}{cc} 0&-1 \\ 1  & 0 \end{array}\right).$$
Again, one can exponentiate: $r(\theta) = \exp ( \theta R ).$ 
In the following, the aim is to read off the weights of the non-split torus
$$ \{ r(\theta)\mid \theta \in \mathbb R \}$$
from the weights of the split (diagonal) torus $\{d(t)\mid t \ne 0\}$.
Complexifying, in $SL_2(\mathbb C)$, the non-split torus above splits, and one can conjugate (i.e., diagonalize)
$$  \left( \begin {array}{cc} x&-y \\ y  & x \end{array}\right)$$
where $x^2+y^2 = 1$ to diag($x+iy, x-iy$), using the matrix 
$$ P = {1\over 2i}\left( \begin {array}{cc} 1&1 \\ -i  & i \end{array}\right).$$
 (The $1/2i$ factor is to keep the calculation in $SL_2$ - one can safely ignore it.)
In any case, in the complexified Lie algebra, one sees 
$$ i H = P^{-1} R P,$$
so that the eigen-values of $R$ (on the complexified representation) are of the form $i k$, where $k$ are the eigen-values of $H$. In particular, $0$ is an eigen-value of $R$ iff $d$ is even. Since both $R$ and $0$ are real, the corresponding eigen/weight space  is real -i.e., comes from the original real representation (iff $d$ even).
Explicitly: if $d = 2k$, $X^kY^k$ is the  $0$-weight representative for the diagonal torus: if one applies $P$ to it, one obtains (up to a scalar) $(X -iY)^k(X +iY)^k= (X^2+Y^2)^k$ - which is real-valued, and of course invariant by rotations... 
Remark 1 - $K=SO_2 ( \mathbb R)$ is of course compact, with the result that the characters are unitary (i.e., have compact image in $\mathbb C^{*}$); thus, one cannot conjugate $K$ to the diagonals over the reals. On the other hand, the complexified tori are isomorphic - i.e.  we can write $1= x^2+ y^2 = (x+iy)(x-iy)$ - and conjugation is possible.
Remark 2 - this is to complete/correct comments that I made in the off-line conversation (including the spelling of the word 'choking'.)   
Remark 3 - in the conversation, I suggested as reference chapter 2 of Knapp's Representation Theory of semi-simple groups, but it doesn't seem to have this explicitly, unless I am misreading.
Remark 4 -  $d$ is the degree of the homogeneous polynomials - i.e.,  the maximal weight of the representation - the dimension of the representation is $1 +  d$. So the representation has a non-zero $K$-fixed vector iff the dimension is odd. (Sanity test: the space of polynomials of degree $0$ has dimension 1 - and $K$ fixes the space.) 
