ifconfig has been removed, in favor of ip: https://unix.stackexchange.com/a/145449/361960
Ubuntu Server is different from Ubuntu Desktop: Ubuntu Server uses Netplan to manage the network connections.
Here's a guide on how to connect to WiFi using Netplan: https://tttapa.github.io/Pages/Raspberry-Pi/Installation+Setup/WiFi-Setup.html
I've never tried ...
Bart van Leeuwen pointed me to CustomPiOS as a nice solution:
It may not work for my project, because it is bound to Raspbian (and I will need PiCore), and it is not Python, but as far as I can know, it is the best solution to the problem of generating custom images for Raspberry Pi projects.
Here is a list of ...