An irreducible representation $\phi:\mathfrak{g}_\mathbb{C} \rightarrow GL(\mathbb{C,n})$ is a Lie algebra homomorphism by definition. That is, it's linear.
So, to consider your example, we see that for $x,y \in \mathfrak{so}(3)$,
\begin{align}
\pi(x+iy) = \pi(x)+i\pi(y)
\end{align}
which shows that working with
\begin{align}
\pi: \mathfrak{so}(3) \rightarrow GL(\mathbb{C,3})
\end{align}
is the same as working with
\begin{align}
\pi: \mathfrak{so}(3)_\mathbb{C} \rightarrow GL(\mathbb{C,3})
\end{align}
(if this doesn't convince you, try to construct a counter example to the proposition and you'll see that it's impossible precisely because any irreducible representation is a homomorphism).
Well, if you come to the definition of a Cartan subalgebra (in an arbitrary finite-dimensional Lie algebra over an arbitrary infinite field — denote by $d$ the dimension), you see that it is defined as $K_x=\mathrm{Ker}(\mathrm{ad}(x)^d)$, where $x$ is regular, and regular precisely means that $K_x$ has minimal dimension.
So, the Cartan rank (I don't like calling it the rank in this generality) is by definition $\inf_{x\in\mathfrak{g}}\dim\mathrm{Ker}(\mathrm{ad}(x)^d)$.
Moreover, if $\mathfrak{g}$ is semisimple in characteristic zero, then the Cartan rank is $\inf_{x\in\mathfrak{g}}\dim\mathrm{Ker}(\mathrm{ad}(x))$.
This is, at least, in principle, constructive: choose a basis $(e_i)$: consider $w=\sum_i t_ie_i$. Compute $\mathrm{ad}(w)^d$, treating the $t_i$ as indeterminates. Then you get a $d\times d$-matrix with entries in $K[t_1,\dots,t_n]$. Computing the determinant of all minors yields its rank (some number $k'$), and hence yields the Cartan rank (which is $d-k'$).
This shows, if $K$ is a computable field, that there is an algorithm whose input is $d$ and the $d^3$ structure constants of a $d$-dimensional Lie algebra, and outputs the Cartan rank.
In practice, this is not greatly efficient, because you don't want to compute $\mathrm{ad}(w)^d$ (which involves huge polynomials) and so many minors within it.
So there is a better algorithm. If $\mathfrak{g}$ is nilpotent, the Cartan rank is $d$. Otherwise, there exists $x$ with $\mathrm{ad}(x)$ is not nilpotent (this is a theorem, e.g., in Jacobson's book). The first step is thus to determine if $\mathfrak{g}$ is nilpotent, and otherwise to find $x$. One can efficiently compute the center (as equal to $\bigcap_i\mathrm{Ker}(\mathrm{ad}(e_i))$) and so on, so this computes the ascending central series, and its union $\mathfrak{z}$ ("hypercenter"). If $\mathfrak{z}=0$, then $\mathfrak{g}$ is nilpotent. Otherwise, one has to find $x$. Since generically $x$ is not ad-nilpotent, I'd say that an efficient non-deterministic way to find a non-ad-nilpotent element is to pick a "random" element and check if it's ad-nilpotent. Then one computes $\mathrm{Ker}(\mathrm{ad}(x)^d)$. If the latter is nilpotent, this is a Cartan subalgebra and we are done. Otherwise, we find a non-ad-nilpotent $x'$ therein and we go on (actually, if $x$ was chosen sufficiently random, one step should be enough).
Best Answer
The problem is that the property "diagonal matrices", or "antisymmetric matrices" depends on the basis of the underlying vector space. The standard way to represent the Lie algebra $\mathfrak{so}(n)$ faithfully by matrices, is by antisymmetric matrices. However, we may also represent $\mathfrak{so}(n)$ faithfully by matrices which are not skew-symmetric. The same is true for Cartan subalgebras. They may consist of diagonal matrices in one representation, but to completely other matrices relative to another representation.
However, we can always say that over a field of characteristic zero, all Cartan subalgebras are isomorphic (and even conjugated over the complex numbers).