Hi Chris - this doesn’t answer your question directly, but have you considered using an external database (such as MySQL) instead of DataTables?
I suggest it because (a) it’s what I do, and (b) because you could push the sorting off to the database server. 20k rows wouldn’t normally worry MySQL and it will handle things like sorting for you. You could requery the DB every time they change the sort criteria and get back a pre-sorted result set that you can just render to your controls back to you in (quite likely) sub-second time.
Might not suit you, and there may be a solution for you baked in to Anvil, but I thought I’d mention it.