I definitely agree with the sentiment that pillagers need to have some sort of counter that the player can use, having them be able to spawn anywhere at any time with virtually no restrictions is really bad. Especially considering how strong they are in groups, particularly in the early-game. This is one of the few things I believe Mojang actually did wrong.
However, for those of you who don't mind a little command-fu in your survival worlds, there is a nifty trick you can use to protect your villagers. "/data modify entity @e[type=minecraft:villager, limit=1, sort=nearest] Invulnerable set value 1", when used standing next to a villager, will make them immune to all damage (except being punched by a creative-mode player). This is also handy since villagers still tend to walk into things that kill them, even with the supposed AI improvements in 1.14.
I normally avoid using things like this in survival worlds because it feels cheaty, but in the case of villagers, their sheer stupidity demands it. Anything short of trapping them completely or making them immortal WILL end in them getting themselves killed. So instead of trying a hundred different ways to protect them, all of which will inevitably fail one way or another, just make them immortal! Problem solved, no more worries.