Used from the very first coins up until the Meiji revolution in 1867, the casting process for Japanese coins has remained largely the same, barring the exact materials and quality checks. Firstly, after the design of the coin had been created and approved, with characters written in most cases by the emperor/empress or by another important public figure, very high quality engraved coins are made (known as 彫母銭, or roughly "engraved mother's money"; these coins are extremely rare). From these, high quality tin issues were produced, which are known as 錫母銭, which means, quite literally, "tin mother's money." From these, copper coin would be cast, where these coins are known as 銅母銭, or simply 母銭, meaning copper mother's coins (commonly referred to as seed coins or bosen outside of Japan). These bosen are very similar to the common issues of the final coin, albeit with higher quality material and casting as well as a slightly larger size (the smaller size on common coins is caused by shrinkage of the metal during cooling after casting).
(From left to right) A Chinese Jiaqing Tongbao engraved mother coin (彫母銭), a Japanese Bunkyu Eiho 4 Mon tin mother coin (錫母銭), and a Japanese Kanei Tsuho Mimishiro-Sen 1 Mon mother coin (母銭). Photos sourced with permission from AuctionWorld
In the actual casting process, the mint workers would fill wooden frames with sand and press the bosen and rods (for metal flow) into the sand. Then, sand is poured on top of the coins with another wooden frame, and the sand is compressed against the coins by the workers. Next, the two frames, now moulds, are separated, and the coins and rods are removed. The channels and impressions are cleaned up, and (according to Hartill) the moulds are treated with pine resin smoke to help hold the sand together and serve as a conduit for the molten metal.
After this, the moulds are joined together and stood upright for the metal to be poured in. The channels created by the rods join all of the coins together and form what’s known as a coin tree (or edasen, 枝銭, in Japanese). These are very commonly faked, and any real ones that exist are exceedingly rare.
A replica of a coin tree of 100 Mon (Tempo Tsuho). Coin trees are rare and even the replicas sell for large amounts of money - this example sold for just under $400. Photo sourced with permission from AuctionWorld
Once the metal has cooled, the moulds are separated, the coin trees are removed, and the coins are cut/broken off of the trees. Next, the coins are slid onto square rods and the rough edges are filed down. It appears that this might be the reason why the majority of cast coins have square holes - this holds the coins in place on the rods while they are being filed.
Next, the surfaces of the coins are smoothed, washed, and polished. The resulting coins are the finished product, and the last step is to string them onto strings and distribute.