I use an extension to calculate shipping costs based on distance. There is a free shipping function which is applied when
getBaseSubtotalInclTax() is higher than X. I need the total for all products minus discounts. How do I get it?
$quote->getBaseSubTotalInclTax() already give you the subtotal (i.e. total of all products) without discounts.
If you need the grand total (with shipping and other additional costs), except discounts, you can try to subtract it:
$quote->getBaseGrandTotal() - $quote->getTotals()['discount']->getValue()