If historical fiction involves real life people, I'm going to have to say it's a fanfiction.
If you think about it, the "fiction" part of fanfiction comes from the fact that you are writing fiction, not taking inspiration from a fiction. It is fan-fiction. It is fiction, made by/ derived by/ from a fan. Nothing in the definition requires the source material to be fictional.
Furthermore, the creation of such a story hinges about the same "what if..." questions that normal fanfictions often arise from.
If it's only real life events, without the direct existence of any real individual, we could perhaps argue that it's not a fanfiction, only heavily inspired. I don't have an argument on why I think that way, though.
With that kind of logic, I think the interesting extreme point is when authors include mythos. Like the use of the Greek or Norse gods. We generally wouldn't consider said stories to be fanfiction, even though they adopt characters from fictional sources.
I guess we could make the argument that we aren't actually interesting in taking specific characters (fictional or otherwise) called Aries, Hades, or Zeus, but rather, we are interesting in taking the general concepts that they represent, along with their names. Much like I could take the concepts of orcs, dwarves, and elves and still not have my resulting story be a fanfiction.
I guess the idea is that fanfiction needs to be derived from something specific, rather than something general?