You can gain over 200 extra cards without using extra buys. The limit to the number of buys will come from component limits rather than anything inherent in the game, the most important number being the number of each treasure card you play with (as there are at baseline only 136 cards to gain). Ignoring that, the number of types of kingdom cards and the number of each kingdom card in play is also a substantial limitation as you can only pick a subset of the following abilities to use together in an actual game.
Mechanisms of gaining extra cards
There are four distinct ways to gain extra cards during the buy phase.
Extra buys. This is the normal way, and so is not what we're considering here. Via action chaining and action replication, the limit on extra buys you can get comes purely from component limits.
Action hacks. The Innovation project lets you play an action card during your buy phase, and there are a bunch of actions that let you gain cards.
Triggered abilities that cause you to gain cards.
Free cards. Treasure Chest gives you an extra card every buy phase.
All of this assumes arbitrary setup and that you are going to buy a King's Court for maximum action hacking.
Action Hacks (260 extra cards*)
Have the following in your hand:
Now when you buy a King's Court, you use that to play an extensive tree of King's Courts and Throne Rooms, which will letting you then play a bunch of other action cards that will happen many times. I believe the optimal way to play it is Throne Rooms first and King's Courts second, giving you ability to play 18 actions 3x each and 11 actions 2x each.
If we rig the game (let's say everyone is playing big money with massive decks) and it's 6 player, Thief will gain you five cards every time, so that's one of the one we want to use on the 3x actions. Beggar gives the second most (3 cards per shot), so this is what we want to use the rest of the 3x actions on. This is already 216 cards*. We can then use the remaining 2x actions on Develop/Remake (2 cards per shot) for another 44 cards.
* This number may be lower in practice depending on how many coppers (and silver if you use Trader) are in the supply.
Triggered Abilities (100+ extra cards)
The cards in this category I know of that work with the action hack above are:
(Hoard and Port aren't going to work because they only trigger off of buying a certain type of card.)
Taking component limits into account, we're only going to be able to use 10 of each of the triggered ability cards. The cards listed above let you gain over 100 extra cards (given we have some way to trash cards during the buy phase).
Maximum without projects (50 extra cards)
Without using the Innovation project, the limit here is going to be the most triggers we can chain off of one buy.
In this case, I believe the optimal move is to play 10x Hagglers, 10x Hoards, and then buy a Province. This will let you get 20 extra cards, 10 of which can be Border Villages, which can in turn let you get 10 Caches or Death Cards, which will give you 20 more cards. This gives you a total of 50 extra cards.