Consulate or embassy, they really should have more distance between them and whatever potential “incoming”, with nothing adjacent other than buildings somehow related to their own.
Most consulates around the world are a small suite of offices, frequently manned part time, and providing limited services. The US usually has better facilities and better security than most. For the US taxpayers to provide 307 fortified compounds around the world for its embassies, compounds, and missions is neither practical nor cost effective. And it sends the wrong message, along the lines of Jimmy Carter cowering in the White House during the Iran crisis.
Some embassies close to street. Some large compound. Built before car bombs