Goldfinger knew gold but nothing about gun play in a plane.
That's actually all but impossible. It takes a VERY large hole in the airplane (like the one created with a bomb) to experience "explosive decompression" -- i.e. decompression that happens so fast that you are sucked out.
A bullet will only punch a hole in a window -- it won't shatter. Even losing a window is only going to make a lot of noise. Depending on the size of the plane and the window, the pressurization system can still maintain a low enough cabin altitude to breath normally.
Debunking "The Goldfinger Myth"
The problem with a bullet isn't punching a hole in the cabin wall. It's punching a hole in something vital like a fuel tank (yes, those are very close to you, especially in a small plane), or an oil line (again, very close). Or, you can compromise a control linkage: in a plane without fly-by-wire, the control cables to the rudder and elevator run right under your feet.
However, when faced with a terrorist, I'd take my chances. There are also frangible bullets that dissipate all their energy on impact, making them less risky on an aircraft. But, I doubt the pilot would check your load-out -- he would just do like every gun show does: show it empty and locked open.