Faster method for converting a dimensionless quantity to a scalar.

Since `Unit.to` is rather expensive, this method is about 4x faster on my machine.