Is there a better way of finding the order of a number modulo $n$?
For any $a$ and $N$ with $\gcd(a,N)=1$, the order of $a$ modulo $N$ must be a divisor of $\varphi(N)$. So if you know the prime factorization of $N$ (or $N$ is already prime) so that you can compute $\varphi(N)$ and also know the prime factorization of $\varphi(N)$, you can proceed as follows:
If we know an integer $m>1$ with $a^m\equiv 1\pmod N$ and know the prime divisors of $m$, for all primes $p$ dividing $m$ do the following: Compute $a^{m/p}\bmod N$ and if the result is $\equiv 1\pmod N$, replace $m$ with $m/p$ and repeat (or switch to the next prime divisor if $m$ is no longer divisible by $p$). When you have casted out all possible factors, the remaining $m$ is the order of $a$. Note that the computations $a^m\bmod N$ do not require $m$ multiplications, but rather only $O(\log m)$ multiplications mod $N$ if we use repeated squaring.
If $N$ is large and the fatorization of $\varphi(N)$ is known (and especially if you suspect the order of $a$ to be big), this is in fact a fast method.
Note that a couple of computations can be saved even beyon what is descibed above: In the case $p=2$, we may end up computing $a^m, a^{m/2}, a^{m/4},\ldots$ to cast out factors of $2$. But the later numbers were in fact intermediate results of computing $a^m$ by repeated squaring! Also, once we notice for some $p$ with $p^k\mid m$ that $a^{m/p}\not\equiv 1\pmod N$, we can save a few squarings and so speed up the task for the remaining primes if we replace $a$ with $a^{p^k}\pmod N$ and $m$ with $m/p^k$ - just remember to multiply the factor $p^k$ back into the final answer!
In your specific example, we know that $N=41$ is prime and that $\varphi(N)=40=2^3\cdot 5$. We check $p=5$ and note that $2^{40/5}=256\equiv 10\pmod{41}$, hence the factor $5$ cannot be eliminated. After that we check how many $2$'s we have to use: $2^5\equiv 32\equiv -9$, hence $2^{10}\equiv 81\equiv -1$, $2^{20}\equiv (-1)^2\equiv 1$. We conclude that $2$ has order $20$ modulo $41$.