Enter Mold Earth, a Sorcerer cantrip which can excavate dirt in 5x5x5 foot chunks. With this, we can simultaneously build both a moat on the outside of our wall, and an earthen ramp on the interior.
We're back to 10x10 walls that are six inches thick, 15 AC, 90 HP. We want a tile of flat earth about 7 feet high inside our wall for our defenders and sentries to stand on. At a reasonable grade, it'll be another 10 feet behind this to get back to ground level, and require either three or four turns of earth-moving for our 7.5=5=2.5' ramp, at the same time carving out a moat on the exterior which is the inverse of this. For each section of wall, we need an additional minute to perform the terraforming. This puts our workday at just about an hour and a half.
Putting a wall around Phandalin, pic related, would require ~2,500 feet of wall, or 32 days of casting by our Sorcerer who can manage 80 / day, with maybe another day or so for making sure ramps aren't too close to farms, the walls have proper gate openings, the ramps are nice and shored up at the gates, and so on.
If you really want to get fancy, you can build a few horizontal walls (10x20), score them, and break them into strips for joining as a drainage system for the ramp so nothing gets swampy and all rainwater is funneled under the walls and into our moat. This actually requries some physical labor on your part, but we've dedicated our life to being the best wall-building Sorcerer so it's no big deal to learn how the fuck mortar and engineering works.
A six inch thick brick wall (a little under one standard brick's length in thickness, basically) requires 120 bricks per square meter. Our 10x2,500 is ~3x762 meters, and would require ~250,000 standard bricks if constructed in the normal fashion. We're making quality walls, so let's assume a price of $500/thousand on our bricks, or $0.50/brick. Price of mortar and labor basically triples this per square foot.