You pay half for a bonus. Asteroid mines add a flat value rather than a percentage, so they don't count-you pay full for them.
This means if I have, say, 40 industry on a planet, with a 60% military bonus (and assuming I'm running at 100% funding and 100% military), I get 40*1.6=64 military out of it, and I pay 40 + 40*0.6*0.5 (60% bonus and 50% for what we pay) or 52bc for it.
It gets a little more complicated if you involve focus, due to how bonuses are treated, and there's some weird bug with regards to the Artificial Slave Center, but overall, that's how it works.
As for a free lunch...this is not the free lunch you're looking for.
No, really.