Why do toroid inductors have a square cross-section?
When making a ferrite toroid, you start with powder that has to be compressed, then sintered. It's much more practical to have a mould with substantially parallel sides, and compress in one direction. The main criterion for cross-section is manufacturability.

The theoretical shape that maximises power throughput for a toroidal transformer core is a nearly circular (sort of egg-shaped) toroid. The larger the hole in the middle compared to the cross-section, the more nearly circular it is. This shape jointly minimises the magnetic and electrical lengths, and so the losses. For any given pair of core and conductor materials, so core of ferrite, iron powder, or iron tape, and windings of Cu or Al, the optimum cross section and hole ratio will change slightly.

However, this optimum is a very weak function of the cross-sectional shape, and changes little between a circular and a squarish-with-rounded-corners area.