I would always say to trust your gut and if your instinct is that he wasn't safe to be around then you should pay attention to that.
However, I'm not sure, from your description, how the following is necessarily inappropriate:
He would go on about sex for inappropriate lengths of time, for example he would talk about the Japanese women who were tortured and raped during WW2, (keep in mind we never learnt about Japan in our qualification). It just seemed he enjoyed yapping on about it
Lots of teachers (in my experience the best ones) talk about their subject on topics outside of the syllabus. It demonstrates enthusiasm for the subject (in this case history) and encourages it in others. The syllabus doesn't always inspire interest from students so it's important when good teachers do this.
It's also important for people to learn about atrocities that occurred that might not be covered by the syllabus and the fate of the Japanese women has been the subject of renewed focus in recent years to highlight something many were ignorant of. That is also an important part of history - what we learn about the past is dependent on societies bias. (And the WWII syllabus didn't talk about the fate of Japanese women but its still an important part of wwii history that as victors British schoolchildren haven't formally learned about)
So all of these things could be reason for his focus on this, especially he'd been reading about it in his own time and wanting to share his knowledge. Or perhaps he's close to someone who was directly or indirectly affected.
You don't say whether he was being lechy or just trying to teach about an event you found distasteful.
Can't really comment about him talking about syphilis without context. It was a rife disease in history with a lot of social impact (and potentially political if you believe certain people were afflicted). Many people find it interesting.
I will always tell anyone to make sure they keep safe and err on the side of caution where safeguarding is concerned but I don't think any of us can pass judgement on your history teacher with the detail you provide in your post.