in practice, miners would ignore such transactions unless they paid ridiculously high fees. so it doesn't happen.
such transaction won't even be relayed as it would be non-standard so it doesn't exist in 99.9% of the node's mempool. the only way to see something like this is for a miner to both create this transaction and mine it in which case there is no need to pay any fees.