So in my hardcore world the whole village decided my house was their house now. In hindsight that's on me, I had a lectern and a bed in the bedroom, a cauldron in the kitchen, smokers and blast furnaces downstairs, a grindstone in the attic and probably a dozen or more barrels. The villagers were everywhere, even in the attic.
I really didn't want to swap my copper and spruce doors for iron ones or invert them (it ruins the look), so I ended up making a small Fabric mod instead.
With this mod I can now stand in my house and run /eviction set home 24, that makes a zone 24 blocks out in every direction. Villagers path around it, don't claim anything inside and if one still wanders in it gets moved back out. They still live in the village and I can still trade with them, we're just now not forced roommates anymore.
It's server-side so it works in singleplayer and people joining a server don't need it. 26.1 to 26.3 for now. The gold particles in the clip are only there to show where the zone ends, the mod doesn't show them yet.
Link's in the comments. Curious what you think and which versions you'd want it on.