How about instead of giving farming penalty, we give farming bonus aura to Farmstead, to encourage farms to be build around farmstead instead of CC? Petra AI can be modified accordingly for #4348.
I tried to tackle this issue in my mod City Building mod, primarily by giving population bonus aura to houses as well, to encourage houses to be built around CC. I also already implemented AI changes to the mod so AI will try to position the farms and houses accordingly.