I use a algorithm called recursive backtracker. There are some videos on it that could explain it better than me. Then once the algorithm is complete, I remove random walls so that there are multiple ways of completing the level.
"premature optimization is the root of all evil" - Donald Knuth. So nothing really. I'll post the github in the description, if you want to check it out, and can understand gdscript.