I think there's a way to generate a wifi qr with pillow and qrcode library in Python, but I couldn't figure out how.
Yes there is. QR codes are just images that are easy for a computer to decode via taking a picture into something useful.
QR codes are just text/strings encoded into an image.
Python has a library called qrcode.
Mobile phone support a specific format of text that tells it to try and connect to a wifi network. This wiki shows an example of what that connection string would look like.
So here is the steps.