Your big saving will be in labour, but you're still going to be in it for over $1,000.
How many miles on the engine? How bad was it overheating? If it was at the end of one journey, and you then stopped and didn't drive it to overheating again, you won't need new heads (you can measure the deflection to see if a skim is needed)
The engine is connected to ...
It's a reasonable job once these wide engines are removed from the vehicle. I was quoted US$2-3K at a reputable Subaru workshop. As requested here's some docs to estimate doing the work yourself;
Subaru Legacy/Outback Factory Service Manuals
Subaru H6 Technician Reference Booklet
There's also a couple videos on YouTube and good resources at subaruoutback....