Coincidentally, I went through this myself yesterday when decommissioning a Late 2008 13” Unibody MacBook running Yosemite that I will be recycling.
Too late, I read that if you append the 6-digit 2FA code that shows up on your other device to the password (i.e., use the account password MyPassword123456), Apple’s servers will accept that. Might be worth a try.
You’ll run into the same issue trying to reinstall Yosemite, you’ll be prompted to enter your AppleID and password to download it.
In my case, I read the password trick after several failed attempts and I’d erased the drive (without deauthorizing in iTunes), and I did not get a 2FA request again, but a 403 error when trying to reinstall Yosemite. For me, it didn’t really matter since the plan was recycling, and that was one of the rare Macs where the drive is very accessible (there’s a tab on the bottom to pull that opens a cover, exposing the battery and the internal drive, the latter held in by just two screws – I just pulled and physically destroyed the drive).
I doubt iTunes computer authorizations will be an issue (thanks to Apple Music and Family Sharing), if they are it’s possible to deauthorize all computers on the account from one computer, then reauthorize the active ones.