Sure you can turn off the phone so you don't receive calls but still use the phone connection for data. Just unconditionally forward all your incoming calls to voicemail. Even though you've registered with a foreign cell company by turning the phone on, no calls will be sent your way and you won't be charged. Some super cautious folks would tell you to do the forwarding while you are still in the U.S., but I've been able to successfully do it once I was overseas.
I don't have an iPhone, but there should be a menu option to unconditionally forward calls. If not, AT&T should recognize the GSM codes to do that (send me a PM if you have any questions about doing this). Or, call customer service before you leave and ask them to set it for you. Be sure to change it back once you return, of course.
Although you won't get voice calls, you will get text messages and incur the charges for those. Not sure about AT&T, but with a message package with T-Mobile, I only pay for outgoing text messages. Incoming come out of my package even if I'm out of the country.