So my story will hopefully give you some perspective. I graduated with 145k in student loans with a 6.8% interest rate. I unfortunately HATED my career so I had some serious hustle fueled by hate.
I invested in rental property AND paid on my student loans. Looking back this was definitely the correct decision for myself.
I lived very frugally and house hacked while also making decent payments on my student loans. I would save up 10k or sometimes borrowing 20k from a family member for a down payment on a rental property. I would pay the family member after I was able to get the rehab done and refinance out.
It was a risky play but it worked out for me. Eventually 5 years later my student loan balance was down to 60k and my first rental property had appreciated 80k over what I paid for it so I refinanced that house pulled out 60k and paid off my remaining balance on my student loans. Now 8 years later all that risk and serious hustle has paid off. My student loans are gone (the renters are paying them now🤣).
I make a nice cash flow now from my rentals, that work has truly become optional for me. I have done some stupid things in my life (like getting 6 figures in student loans for a career I hated), but my approach to buying rental property and paying hefty amounts on my student loans was a stroke of genius.