The truth about remaining an individual contributor and staying out of management is just to flatly turn down any offers of management positions. You'll likely make less money because of this. Management will tell you this isn't the case, but in most orgs, power is centered around management. As an example, people with fifteen years at Google were laid off by a management team with less tenure. Maybe they're next, but you'll be first.
The longest I have ever stayed at a job is about seven years and that was several years too long. If you've been at a company more than a few years, your salary is stagnating.
Don't do free labor. That includes an expectation for regular work beyond 40 hours. Learn on the job. Not just by doing new things. Read books, blogs, practice coding during work hours. This is how all other professions operate. I have no side-hustle. I'm a professional programmer.
No one knows what the future will bring. I've professionally written code in a dozen languages and as many platforms. Stay intellectually curious and learn how businesses operate.