I have worked for the last fifteen years as a professional pet sitter which means I am heading out in all directions at weird times of day and night. The person I live with knows my schedule and my intended destinations no matter where I go or at what time.
In some instances, I am driving through and heading into areas where there are few people and even less security in the surroundings. Asking people to leave on porch lights and to have some lights, at least, on timers so I'm not walking up to and into a house that is clearly not occupied seems to not sink in with several clients. Several years ago I had a client in the "bad part" of town and I was driving past one house that was being remodeled (that would serve as a nice place for a druggie or three to spend the night), a house with bars on the windows, then a house with boards on the windows and several houses where those old time residents were clearly trying to maintain a neighborhood.
Even sitting at a stop light, I am aware of who and what is around me. Vigilance doesn't mean looking for trouble but simply being aware of what is happening at the moment. Don't live in fear. It makes you an easy target.
There have been a few times even the walk from the car to the house has been less comfortable than I prefer, particularly when there are large shrubs around the door I use to enter. Once I enter the house there's still every door left closed and rooms without lights that pose a "could happen now" feeling.
More than anything, I try to stay aware of my surroundings and situations.
If something doesn't look right, I don't hesitate to call the police. I walked up to one house on a rather busy street one night and the front door was cracked open. I called the police. No sign of forced entry and nothing askew in the house but better safe than sorry.
IMO the "I went down doing something I love" approach is not justification for "I got captured and now I've been chained to someone's basement post for the last ten years". So, more than anything else, stay very, very aware of what's around you and what you may be walking into. I always go to the location in the daylight before I head out at night and I make myself aware of what's around, how to see the danger zones and the safe zones and how to possibly extricate myself from a bad situation.
Never hesitate to call the police. They would rather find you safe and alive than any other possible condition. I've never had an officer tell me they were being bothered even if the call was just making them aware of someone in a car that maybe shouldn't be sitting in that location.
No photo IMO is worth anything more than the hassle of setting up. Alone time with a camera is all too often time when you are concentrating on your shot and someone can walk up next to you and you wouldn't even know at first.
When you can't fully trust your spidey sense, it would be wise to carry along your batpack utility belt. I prefer non-lethal carry alongs since I figure, should I be overtaken, anything I have with me which could render an attacker immobile could also be used on me.
Go to your local police sub-station and discuss this with them. Explain the situation and get their advice - which, of course, would always be to not do what you're doing - for what you can legally carry with you.
One item I've considered but have never purchased is a 130dB noise maker. Producing an ear piercing frequency at a distance, it will give most people a moment of pause - in pain - while I can reconsider my options. Don't be afraid to warn someone approaching you of your intentions if they reach an uncomfortably close distance. Maybe they're innocent of any bad intentions, maybe they're not.
Mace and pepper spray, tasers and such have the disadvantage of proximity to the other person and having then turned on you to disable you. But follow what the police suggest, they've seen the results of what happens when you don't.
Most of all, don't look like a victim. I'm another six footer and a friend who works at a crisis intervention center once made the comment that I do not carry myself as if I were an easy victim. No one can add an extra six or seven inches to their height but you can learn to not look like you can be easily taken down.
Having any dog with you, even a little one, is always an advantage. There have been several nights when my dog has warned me of other dogs - just as dangerous as people sometimes - and is always on the look out for anyone in our vicinity. The extra few seconds of awareness can be the difference in your safety.
If you've had self defense training, take a refresher course. Not allowing yourself to be the victim, even for a few seconds, can make the difference.
There's so many things that can make a difference that you need to have a mental arsenal with you at all times when you head out on your own.
If you notice someone acting suspicious, get out your cell phone and start calling home or the police. That alone can give some would be attackers enough pause to keep you safe. If someone comes at you, maybe you can manage to take their photo with your cell phone and then toss it into the bushes. You can try to reason with them that you've just provided evidence the police are sure to find.and that they don't have time to locate. If nothing happens, you can retrieve the phone later.
The answer to your question is, there isn't enough advice to give because every situation is different. You need to be aware of the moment and act accordingly. To do that effectively, you can't be lost in the shot. No photo is worth that much if no one ever gets to see it.