Doesn't mean he would have done it in Boston. Fenway is not Citizens Bank Park.
Even looking at least year, he hit 25 in 71 games (303 Plate Appearances) for the Nationals and 7 in 41 games (106 PAs) with the Sox.
I have little doubt he would have done well in Boston this season, but I doubt he would have hit 40 dingers. Would I have preferred him over JD? Certainly, but paying both of them wasn't going to happen (they certainly would have had to pick up a lot of JDs salary).