This method is very simple, but it does not appear on the wiki for 31.04 or for 40d, and a quick search didn't turn up anything, so it seems to be unknown. So here's my contribution to dwarven science:
You can make ice walls very easily by designating a pond over an outside, freezing-temperature tile. Dwarves will drop water from one z-level above, the ice will freeze into an ice floor, then the next time a dwarf drops water on that tile, it becomes an ice wall.
See diagram:
Applications:
1. Infinite stone. Granted, that stone is ice, but still. Infinite given infinite water. And if you have ice and you're clever about it, you can get infinite water (2/7 of water freezes to an ice wall, which melts to 7/7 water).
2. Ice walls can be built in this way even on map edges. If you wanted, you could close off your fort entirely, or force people to come in from a certain side. I haven't tested this, though.
3. The ice walls are somewhat impervious to cave-in, if you're very, very careful. If the ice wall that forms is not supported, it does NOT immediately cause a cave-in. Instead, it just hovers in midair until you build a construction, or dig, or basically do anything that could normally cause or prevent a cave-in. Water always falls exactly one z-level before freezing.
4. Easier to make than obsidian.
5. Nothing can survive being encased in ice.
Drawbacks:
1. The infinite stone is ice, and there is seldom a shortage of stone anyway.
2. The ice walls will melt like normal ice if your climate is warm enough for ice to melt in the summer.
3. Weird stuff happens with ice walls made on map edges. As far as I can tell, sometimes they give support, and sometimes they do not. Sometimes, they'll even cave-in.
4. Needs a cold climate.
5. It's a slow process. Only one dwarf at a time will fill a given pond. But if you designate a separate pond zone for each tile, it'll go a lot faster. But unless you use macros, it'll take a long time to order all the pond designations.
6. Lots of "inappropriate building" job interruptions as ice walls are made.
7. Ice walls cannot be made on the top z-level with this method.
This should work in both 40d and in 31.03. I haven't tested it in 31.04, but it should work.