What is your personal APR threshold for paying down extra debt vs investing?

I have about 10k remaining on a car loan at 2.5% interest, and about 5k of student loans at 4% interest.

I make enough to pay down the debts quicker if I wanted to, but I've been opting to do regular payments instead, using my savings to invest in index funds and some tech stocks.

I think pretty much everyone will agree with me on using extra cash to invest rather than pay down a 2.5% debt, and a lot will agree with the 4% - my question is, what's your personal threshold? At what APR would you shift gears away from investing and start aggressively paying down debt for the guaranteed return of not paying interest on that debt?