I honestly think modern warfare did a decent job of this, you had the battle pass but I only actually paid for it once and would unlock credits allowing you to buy the next month and have some left over to buy the odd gun but you would also unlock everything else that mattered.
Attachments would unlock through the use of the gun, but even if you sucked would unlock fairly regular.
I don't think any of the unlocked weapons provided a massive advantage over the base set, more some suited a play style that you may have.
Having played a bit of BFV, I just don't feel an attachment to a certain weapon and unlocks for that weapon seem to take ages.
The pay for the good guns and everyone has that option puts me straight off within a week as I'm at a disadvantage unless I'm willing to spend money on the game I've already paid more than I'd like for.
As i say, it's a very tricky concept to balance right.
BFV does have some of the decent guns that are only unlocked after you've hit like level 10+ in that class. Then also the gun itself needs to be leveled to 4 to get all unlocks, and some of these can have a huge advantage such as faster rate of fire, quicker bullets, quicker reload, deals more damage, or has better accuracy.
For most day1 players, xp levelling weapons isn't a massive issue. Yes you'll always get a minority that will play it for 24 hours straight on launch day to unlock everything, but normally within a few weeks most of the player base has then unlocked all weapons.
The challenge is for players who join much later on, i didn't start BF5 until it had been out probably 12-18 months. I found the starting weapons absolutely ****, and the only way to make them better, or unlock better weapons is to get points, and it's quite tricky to get points quickly with **** weapons. Basically you end up getting killed a lot to rack up some points, or you just camp out in some corner and just shoot the odd person that walks by. That ends up causing a number of players to give up before they've even given the game a proper chance.