There certainly is a "way" to calculate many costs, probably not all, of a product which are not currently included in supply/demand price setting. The failure to include calculable costs and instead passing those costs on to society to pay, through taxes, health costs, environmental losses, etc., results in under-pricing of those products and consequently in demand greater than would result if the actual cost of the product was included in the price setting mechanism.And how exactly would you calculate a cost like that? There is no way to do such a thing.
An example of many possible. A well known and common practice in the auto safety arena is the ability to reasonably calculate lives lost, injuries suffered, medical costs incurred, etc. as a result of not wearing seatbelts. Knowing those costs allowed for regulation requiring seatbelts, which raised the price of cars with seatbelts vs other modes of transportation without these costs. Ditto the multitude of other safety devices on cars. The elasticity of demand partly will determine the extent to which these price increases resulted in less demand for cars, but if demand was highly elastic, demand would have fallen for cars with these devices because of increased costs and probably would have increased for public transportation.
The ability to calculate the health costs of air and water pollution is quite advanced, and regulation has required some producers to add devices to reduce their pollution, which has raised the prices of the products of those producers. But other producers are not required to do so, which keeps their prices lower than the truer costs of their products. Instead, you and I, society in general, "pays" these costs rather than those who purchase the product.