Book seven, in fact, presents three ways to defeat death, and they are highly illuminating.
Firstly, there are Horcruxes. This is Voldemort's project for immortality: the division of his soul via murder and the darkest magic, and the implantation of those parts of the soul into objects which guarantee that, even should he die, he will live on.
This is, I think it's fair to say, not a vision of the death's vanquishing which the books present as appealing - Voldemort is the darkest wizard of living memory, and the creation of his Horcruxes takes him deeper into evil than anyone has ever gone. Yet it has strange parallels to various current attempts at death defiance. Dividing your soul up and placing it in objects sounds pretty similar to me to uploading your consciousness into a computer.
Now I'm not saying that all transhumanists are evil wizards whose projects rely on murder, but I do wonder if the same impulse lies behind Horcruxes and downloaded consciousness.
There is, in both, the same fear of death, the same refusal to accept that my life might end. And there is the same default assumption that the body doesn't really matter - that the centre of my being is somewhere else, and that I can separate it from this inconvenient vessel which is so subject to injury and decay. The inevitability of bodily death is acknowledged, but life can go on even if my body fails, because I can place myself into objects. What matters is my consciousness, and that can be made eternal.
The second option is a little more complex: the Deathly Hallows. These are three strange, mysterious objects, possession of which promises to make the bearer "master of death." The wand that gives murderous power. The stone that brings back the dead. The cloak that conceals.
The Hallows dress up their promise in esoteric garb - they offer a quest for the initiated that requires a certain embrace of mystery, and they certainly seem friendlier than Horcruxes, since no one has to die to make them.
But in the end, as Dumbledore admits, they are not really that different from the Horcruxes, for those who seek them also respond to the temptation to defy death, just like Voldemort. And if Horcruxes are about preserving the soul in the face of the inevitability of bodily death, the Hallows tease the possibility of avoiding death altogether, through the exercise of power.
The wand gives the power of invincibility and conquest: the avoidance of death through the murder of all who might threaten to kill.
The cloak gives the power to hide, to keep out of trouble, to evade death by escape.
And the stone? The stone overcomes the loss of death by bringing its victims back, by refusing to accept that those we love might leave us.
Again, the Deathly Hallows sounds eerily like a current technological advancement: the rising trend of griefbots. There is the same attempt to respond to grief by clinging to simulations of those whom we mourn, and the same despair at the end of the line. For the dead do not belong with the living, we are told, and legend has it the first owner of the stone was driven to suicide.
The Hallows attempt to deny death through power, and this is why Dumbledore found them so alluring, and so destructive: they promised to wind back his own loss while giving him the victory he thought would give his life meaning.
And yet, in reality, even when Harry unites them all, they don't give what they promise. Indeed, they only work to their full power when they are used for humbler ambitions: to hide friends from danger, to perform wondrous magic without boasting in the glory of the wand, or to face death with the comforting presence of those who have gone before.
For the stone only becomes available to Harry when he finally embraces the third way to defeat the death. The way his parents believed in.
Death, in the Potter books, is defeated by dying. Or perhaps more specifically, by dying for love - love of children, love of friends, love of a world gone tragically wrong.
Harry's mother protected her son from dying multiple times, through the power of her sacrificially loving surrender. Dumbledore, in a complex way, protects Malfoy and saves the Elder Wand from Voldemort, thereby protecting the whole wizarding world, through his voluntary death. Even Snape, in the bitterest and most twisted story of them all, ends up giving Harry what he needs to win and finding a measure of redemption, in and through his own murder.
And, in the climax of this long, convoluted story, Harry avoids death by going willingly to die. Because he loves his friends. Because he hates others dying for him. Because he recognises the terrible duty he faces, the terrible path Dumbledore has laid out for him, and he loves too much to run.
Voldemort is wrong. Love does conquer death.
The parallels to the Christian vision of death are stark. The quote on the tombstone which sparks these reflections for Harry (and for me) is in fact from the Bible. "The last enemy that shall be defeated is death" is a profoundly Christian idea.
Yet my friends were right to react negatively to what they thought I meant by death being an enemy.
For, just like the good guys in Harry Potter, Christians have traditionally been suspicious of attempts at immortality on our own terms. The Bible, I would suggest, knows nothing of a technological defeat of death, whether through downloading our consciences, or radical life extension, or technologies of power. Death cannot be staved off by any of our own work.
But this does not mean that death is a good thing, simply a part of human existence which we would do well to welcome and learn to get along with (though I do think we would do better to think about death more, and be more honest about its existence).
Death is an enemy. It is the final enemy. We are right to rage against it. To grieve those whom we lose. To feel its existential weight.
Yet, perhaps paradoxically, we should not fear it. For death is an enemy that has been vanquished, but vanquished through Jesus' death.
Immortality is not, for Christians, something we achieve, but something that is given to us. We believe in the Saviour who dies, and who rises again, and in whose resurrection, as strange as it may sound, we also will be raised. Death is defeated by love, but it is not our love, it is God's love for us.
This gift, according to the early Christian writers, can only be received by going through death, not by avoiding death. Indeed, Paul's letters, which make up most of the New Testament, are full of the insistence that the pattern of Christian life is always death first, then life. Death in baptism, to new life in Christ. Death to sin, to life in freedom. Bodily death, to bodily resurrection.
And so, what I should have said to my friend, is that Hermione is right. Death is the final enemy to be defeated, but this does not mean the ways of the Death Eaters. It does not mean projects of immortality, whether rooted in science, or a mystery cult, or power over others.
Rather it means it life after death - a life that is given to us, by our saviour who has been through death and defeated it.
Death is the enemy but it is not our enemy to defeat. That victory was won for us, on Easter Sunday 2000 years ago, in a cemetery near Jerusalem, when Jesus rose again.