For those farms where there is simply not enough space for fences, keeping Deer and Boar away should work with a Scarecrow as well, basically a structure you can place anywhere on top of a farm.
If you want it to not be quite as good as a proper fence, give it a limited radius and perhaps make it decay over time, having to be resupplied with clothes, willow and logs every so often and perhaps make it not scare away all deer and boars but just based on a decent chance to do so.