I agree with the above posts. Part of you defense should be, for want of a better word, attitude. Numerous studies of street crime over the years has shown that certain factors increase your chances of being a victim. Things like looking out of place (e.g. the tourist with the camera around the neck, etc), looking lost, confused, etc, being off the "beaten path," walking like you may have a physical problem and so on. My experience is some not so nice places seem to confirm this. Look like a victim and you will be one. Look like you know what you are doing and you are less likely. The trick is not to come off aggressive, but like you are not worth the effort when there are easier targets. The cane is a good idea, but don't walk like you are depending on it.

A part of this is situational awareness. Are you familiar with the walk home route? If you would not feel comfortable walking there in "normal" times, would you really want to do it in "bad" times?" is there a better route?

I also might have to walk home, a much shorter distance than your near "marathon" (about 7 miles). I think some route planning and alternative routes, along with some planned stops/safe-havens might be worth thinking about also. 25 miles at 3 miles an hour is about 8 hours: a good hike in the best of conditions, and your walk will not be in the best of conditions (nor will mine).

_________________________
"Better is the enemy of good enough."