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?
One unusual mental trick that can help with problems of the form bp is:
Step 1: Convert p to binary, drop the leftmost bit.
Step 2: Working from left to right, and starting with b, take each 0 to mean "square the current total", and each 1 to mean "square the current total and then multiply by b". Work through each of the binary digits until you have your answer.
This is a sort of generalized way of working with Lucian's approach.
Let's try this with 227.
27 in binary is 11011, and dropping the leftmost digit, we have 1011.
We start with a current total equal to the base, 2, and the leftmost 1 in 1011:
1 says "square current total, then multiply by 2". 2 squared is 4, and 4 × 2 = 8 (our new current total).
0 says "square current total". 8 squared is 64 (our new current total).
1 says "square current total, then multiply by 2". 64 squared is 4,096, and multiplying by 2 gives us 8,192.
1 says "square current total, then multiply by 2". (8,1922) × 2 isn't impossible to do in your head, but you do need to be familiar with (and have practied) techniques for squaring 4 digit numbers in your head.
Since you specifically asked for a way to do this mentally, I Hope you find this technique interesting.
EDIT: Looking over Lucian's post about 210 ≈ 103, here's another way you could approximate the answer:
Break the problem up into groups of 210, with the final term being 2x where x < 10 (if needed).
With 227, you'd think of that number as 210 × 210 × 27.
Next, replace the final power with its actual total. 27 = 128, so the problem is now 210 × 210 × 128.
Now you replace each 210 with 103. Our problem now becomes 103 × 103 × 128, or 128 × 106.
Compact that into scientific notation. 128 × 106 = 1.28 × 108.
You might leave that as your final estimation, or you could increase your accuracy, if desired.
103 + 2.4% = 210, and in our 227 example, we used that twice, so we need to add 2 × 2.4%, or 4.8% to adjust our estimate.
I'm a little weak on being able to do 4.8% of 1.28, but 4.8% of 1.3 is about the same. I can just multiply 48 × 13, and divide by 100 (to adjust for multiplying 4.8 and 1.3 each by 10) and 100 again (since 4.8 is actually a percent).
48 × 13 = (48 × 10) + (48 × 3) = 480 + 144 = 624. 624/10000 = 0.0624. Add that to 1.28 and we get about 1.34.
This means our best estimate should be about 1.34 × 108.
The actual answer to 2^27? 134,217,728, or 1.34217728 × 108.