How to get 400 hp out of 1971 340 .30 over

It boils down to the sum of parts, going to need some head work to reach an honest 400.
It can be done with over the counter parts but you will need to open your wallet.
Most of the 340's with subpar factory heads are running well under 400.