Is there a shortcut for raising 2 to the power of a number (e.g. $2^{27}$)? In networking, when dealing with subnetting, you convert the net mask to binary and count the number of ones (for the example in the question there would be $27$ $1$'s) and to figure out how many subnets that will make you raise $2$ since each digit only has two possibilities ($0$ and $1$). The professor told us to start off with the first digit saying the value and counting them that way, but it can get tedious with $27$ integers. I went to one of the math professors and he taught me (I may be incorrect with the name) The Russian Peasants Multiplication Algorithm, which is equally as tedious.
What I am asking is basically if a trick has been discovered to quickly and mentally (hopefully) raise to by any number?
 A: 
What I am asking is basically if a trick has been discovered to quickly and mentally $($hopefully$)$ raise two by any number?

$$a\cdot a=a^2,\quad a^2\cdot a^2=a^4,\quad a^4\cdot a^4=a^8,\quad a^8\cdot a^8=a^{16},\quad a^{16}\cdot a^8\cdot a^2\cdot a=a^{27}$$
$\qquad$ You might also want to approximate at each turn, if $($great$)$ precision is not required.
$\qquad\qquad$ For the specific case $a=2,\quad2^{10}\simeq10^3$ might prove to be a helpful shortcut.
A: Yes, but its not just $2$, its actually any number. However, majority of people use base $10$ so it would be easiest to explain it like that.
Let's say we want to find $10^{17}$ Well that's easy. Just take a $1$ and follow it with $17$ $0$'s (A well known trick). So we would end up getting $100000000000000000$. 
So at this point, its really easy to do for base $10$, but if we wanted to do a different number, say $5$, we need to use a different base: base $5$.
This time we instead of using (0,1,2,3,4,5,6,7,8,9), we will only use (0,1,2,3,4) to count. So here's how counting works: 1, 2, 3, 4, 10, 11, 12, 13, 14, 20 ... (21-30's range then)... 40, 41, 42, 43, 44, 100. And so on. Now the numbers are not removed, (that's why the number 17 still exists in this system), but each number is just re-written. $17$ would now be represented as $32$ because the 17th number in the new counting system looks like 32. This new method of representing numbers gives us a quick way of calculating $5^x$. For example $5^{13}$ would be a $1$ followed by $13$ zeros: $10000000000000_5$ (the $_5$ just we are using base $5$). So using representation of numbers, we can expand from 5 it into any integer (including 2).
So this property is great and all, however it has one flaw. Converting a base into a new base takes way more time than it does than to actually just calculate $2^x$ by multiplication. So this property is only useful if we are doing a lot of these types of calculations.
Now what's so specially about base 2? Well it only uses (0,1). Sound familiar? Yep computers use the base 2 representation of numbers, so when we need to compute $2^{11}$, a computer will write its as: $100000000000_2$. But the correct answer is $2^{11} = 2048$. And this brings back the flaw. Computers can use this property, but if a human (who uses base 10) ever wants to understand the correct answer, it must be converted. But the only way of converting from base 2 to 10 is to calculate $2^x$ anyway.
So, if the calculations were strictly done in a computer, then yes it would be faster, but because humans use the base 10 system, we need to convert it from base to base. However, we can still calculate $10^x$ very easily because we do use base 10.
Lastly there is one interesting property that @Lucian pointed out. It's called Exponentiation by squaring. And that's the easiest way to solve that if you aren't in base 2, but I'll let you read his post.
A: The Russian peasant method can be used to multiply or to exponentiate:
// Multiplication                 // Exponentiation
let x0 := x, y0 := y              let x0 := x, y0 := y
r := 0 ;                          r := 1
invariant y0*x0 = r + x*y         invariant y0^x0 = r * y^x
while x != 0                      while x != 0
    if x is odd                       if x is odd
        r := r + y                        r := r * y
        x := x-1                          x := x-1
    x := x / 2                        x := x / 2
    y := y * 2                        y := y ^ 2

On the right is the method mentioned by Lucien and Grey Matters.  So there is nothing new here.  But since the question mentioned Russian peasant multiplication, I thought I would tie their answers to Russian peasant multiplication.
A: Simple way to mentally estimate 2 to any power: $2^{10} \approx 1,000$ (actually 1,024).
E.g., $2^{27} = 2^{20} \times 2^7 \approx 1,000^2 \times 128 = 128’000,000$.
Real answer is 134 million - not bad for a mental estimate. You’ll always be a bit low because you estimate 1,024 as 1,000, but you’ll be close. The higher the power, the further off.
Another way to think of it, separate your power into tens and ones. for every ten powers of 2, you add three zeros to a 1, then for the ones you just double the result that many times.
E.g., $2^{13} = 1,000 \times 2 \times 2 \times 2 = 8,000$
E.g., $2^{32} = 1,000’000,000 \times 2 \times 2 = 4$ billion
