The most painful way for the boar to die would be kosher slaughter. That is for kosher animals - which have two blood cords from their brains to their bodies. Not kosher animals have 4, two in the front like kosher, two in the back extra. If you were to cut the two front cords, they would feel all the pain from it, as blood is still connected to their brains. The only humane way to kill one is to shoot it in the brain. If they are destroying your crops, we eat, piggy's gotta go. They can also maul you and if you have a nature walk there, have to keep the population in check. For kosher animals, once as the two cords are cut, no blood from their bodies reaches their brain, and therefore they can't feel anything and do not die in pain.
Unlike other not kosher animals, we are not allowed to derive benefit from the pig, so we can't feed it to the dog after, but if you have befriended ravens (talk more than parrots, extremely intelligent, and bring shiny things for you) you can feed it to them or any other wild animal that you're not benefiting from.
There are ways to slaughter other wild animals humanely, like a trap that catches a deer's body and tightens soft ropes that won't cut it around it, and then you can come behind and never let it see the knife, and if you are a kosher slaughterer with a degree, that is kosher now.