I work in tech and would likely teach if it paid the same. My plan has always been to front load my retirement savings early in my career through tech so that I can take a lower paying teaching job when I'm older.
I’m in the exact same boat. One thing I enjoy doing is guest lecturing at local colleges in CS classes, around topics I have professional expertise in. If that sounds like something you’d like to do as well, I’d recommend getting involved in your local ACM chapter, as most college CS programs have an ACM tie-in.