I spent the first nineteen years of my life living within sight of the building from "Good Times," and even during the crack years, I didn't feel all that insecure. I was mugged only once, and that was pretty trivial. OTOH, I had some classmates who were shall we say "delicately white," often mugged and they resorted to carrying phazer tear gas which worked very well.
Of course, if you don't know where you are and wind up in Morningside Park at 2:00AM, I can't vouch for your safety, but the idea of carrying pepper spray is probably about right. You can generally make a couple of poor judgements, and it doesn't sound like you will be in much danger.
I think the key to NYC safety is a matter of staying out of the wrong places at night. If you're tucked away by nightfall, you'll be fine. Last I checked, you could fit in if you dressed heavily in black and other drab colors.
Have fun. It's an interesting place, but I like Boston a lot better. Enjoy the transsonic trip.