Just get some quotes for the demolition and deduct them from the purchase price, that's the easiest way...
As long as the purchase price is not negative, it would even be cheaper.
The property transfer tax and parts of the notary fees are paid as a percentage of the purchase price in the notary contract.
If the purchase price decreases, the property transfer tax and notary fees also decrease.