Arduinos cost more than a lot of Pis, though. And the network interface of a Pi enables some really interesting capabilities that don't exist, or are harder to obtain, with a device that doesn't have one.
Cool thing about them is that you can write in C-like AVR code (like Arduino), or micro versions of Lua, Python, and other choices.
btw ESP32 are reaching the 6-7$ range for module + serial board.
https://www.banggood.com/ATmega328P-Nano-V3-Controller-Board...
14 GPIO (although with hacks you can do more), including 10 bit DACs on all of them, and 4 with hardware PWM. Most have alternate functions, like I2C, that can be used.