How is it that there are "luxury apartments without renters", yet landlords get away with " rent[ing] out shitty apartments at abhorrent prices"? Why don't the people who can afford those shitty apartments move to the empty luxury ones instead?
Because they're not on the rental market, but are mostly used as a value store by owners that don't live anywhere nearby, and have multiple properties.
Maybe impose a tax on unoccupied apartments past a certain number
A land value tax accomplishes this without the complexities of determining occupancy status or fraud concerning same.