I have not tested this, so use at your own risk.
Backup your DB first!
Theoretically, this will clear only Inventory Purchases and Consumption.
It does not clear any other Transaction data such as Sales.
It does not clear configuration data such as Products, Inventory Items, or Recipes.
DELETE FROM [CostItems]
GO
DELETE FROM [InventoryTransactionDocuments]
GO
DELETE FROM [InventoryTransactions]
GO
DELETE FROM [PeriodicConsumptionItems]
GO
DELETE FROM [PeriodicConsumptions]
GO
DELETE FROM [WarehouseConsumptions]
GO