The stock is dynamic and should be adjusting to your available inventory space. For example, if cloth stacks to 1,000, and you have 10 free slots, you should be able to buy 10,000 in one transaction. If this is not the case let me know and I'll see what's borked.
Vending machines do give stacks beyond the max stack in vanilla, but this isn't intended. It's been a bug for some time now that we decided to patch ourselves. We left it alone for a while, but with the implementation of composters and pickles, it's greatly impacting player economy.