Depends on the point of view. If your biggest risk is you spending that loan money on gambling, then yes paying the debt early would help you get in less trouble.
From an economic point of view, if you don’t need that money at the moment, you should invest it, so that you can make a few bucks. If you get 1-2% more on every transaction that way, it really does stack up at the end, since this will make you exponentially more money.
Tbf I’m really not savvy in loans, but I mean any amount of money X that you have to pay back with Y% of interest in Z days. If you take that loan and you know an investment that will guarantee you (Y+1)% then you should borrow money. (That conclusion is of course completely neglecting risk management)