Across thousands of homes, we have a pretty good sense of the costs here. Since we do the full home inspection before close, it's not as bad as you might think. We've learned to ask about and look for the obvious things (airplane noise, busy streets, recent crime, terrible new neighbors)
The sellers are required to disclose any issues like this, ex. if the police were forced to be called to their neighbors, etc. Other neighbors in the area would know about "terrible neighbors" so if this came out, they could sue the sellers and more importantly the selling real estate broker.