Mac OS comes with the purchase of the hardware. For mobile and tablets, yes, there is a strict walled garden. But I've been programming on Mac OS for longer than the age of this HN account, and even longer on Linux. In practice there's not much beyond the window manager and containerization that are impractical on Mac for every day programming compared to mainstream Linux distros.
The family computer is set up to boot into Ubuntu; booting into Windows 11 is the exception (games, iTunes).