It's basically a recordkeeping problem, not a calculating problem... the calculation is fairly straightforward and automated if you don't identify lots. It sounds hard but in actual practice isn't that bad once you have a system. I'll talk about how I do it as an example.
Back in the dotcom days when I was aspiring to be a trader and was moving my stocks around among different brokerages, I used a website called gainskeeper.com to record all my transactions so I knew the gains, but it cost $50/yr. Later when I finally started using excel for recordkeeping I ended up just keeping a spreadsheet.
Eventually I settled on a single brokerage for all my stuff, and for the 7 years or so that I was at that brokerage I noticed they kept good cost basis records on their website automatically, so I just used the records on their website. They would even calculate the cost basis upon sales, and I found it was easier to just use their calculated numbers because I have never had the need to identify specific lots.
You might think that wash sales would require you to keep your own records, but even wash sales seem to be properly handled by the brokerage website records... they just create a new cost basis record after a wash sale.
Recently I moved everything over to vanguard brokerage in kind, and one of my biggest concerns was transferring the cost basis info. Before I transferred the assets I downloaded excel spreadsheets of the cost basis from my old brokerage. I own funds for a long time, so there were 30 or more cost basis entries for some of the funds from all the dividend reinvestment. In my new vanguard account, there was a link for "enter cost basis" under the account name which would have allowed me to manually enter the spreadsheet data I had downloaded. But I delayed doing that and when I checked a couple of weeks later the link had changed to "cost basis", and most of my cost basis had been entered by someone else. I did double check it and found some errors, which appeared to have occurred due to someone OCR'ing the numbers in from a printout somewhere along the way. There was a link where I could correct those numbers so I did.
I suspect that vanguard's motivation for OCRing the cost basis info was so they would know how active of a trader I was, so they can target marketing and perks to heavy traders. It makes me wonder what other data they may have stored away behind the scenes from my old brokerage records.
From now on I'll just use whatever vanguard tells me is the cost basis whenever I sell.
It seems likely to me that at some point in the near future the brokerage websites will start allowing you to specify lots for sales and will record this as well in the cost basis records, but for now they don't seem to do this.
So in my case it would probably have been harder to let an accountant handle things, due to the fact that they probably wouldn't have noticed the corruption of the cost basis records. I suppose the accountant would have just used the faulty numbers and I would have either paid more or less tax than I owed. If I discovered the error later filing an amended return would be a big hassle.