I love Mexico city, and never felt threatened there, even wandering the "bad" neighbourhoods.
I lived in Mexico City for a full year, in addition to extended trips. Most people I know who live there would laugh at this statement, except to point out that the "bad" neighborhoods are usually the least of your worries. It isn't like most people lurk in their own doorstep to attack passersby.
Are you obviously gringo or not? Four miles from the airport could be just about anything!
If you aren't familiar with the culture, the city busses don't have schedules, but usually come by within 20 minutes and if you have accurate information, you can probably get a bus to drop you within a block of your destination. Getting accurate information is tough, though. It just isn't polite to say "I don't know," so people tend to make things up.
Taxis are very affordable and generally safer than the urban legends suggest, especially if you get an official taxi (I have never had a problem with the green VW bugs, either). If you speak Spanish the buggers will ask you how you want to go, just shrug and look clueless. They aren't going to waste their time going out of their way in that traffic just to run up your fare. They might hit the button for night fare in the middle of the afternoon, but it will still come to about a tenth the cost of your average American Taxi.
If you are obviously gringo, make sure that if you use the metro system (and there is a Poli Tec stop), you have everything in inside pockets so that when the pick pockets stick their hands in, you don't lose anything. I once slapped the same guy away from me three times. The guy across the car was practically in hysterics. I never decided whether he got his jollies from watching this or had decided that I could handle myself. If you use the metro during rush hour, I hope you don't have any personal space issues. The Uniformed Metro Employees will not tell people that there isn't enough space: they will push and shove on any overhanging backpacks or behinds so that the doors can shut. Oh, and people will stare at you even if they don't prey on you. White folk just don't use the metro much. (African Americans are less likely to be threatened, but even more of a rarity).
When is "a few months"?? If you are there in August or September, please promise me that you will have a Chile en Nogada, the national dish only served around Independence Day!!