In theory, that's what the standard deduction is for. If you spend $1MM/month on rent, that's a luxury and should use after-tax dollars. If you spend $500, that's a necessity and should use before-tax dollars. Thus the 12,000 standard deduction: the first $1000/month you spend on rent, food etc is done with before-tax dollars, subsequent dollars use after-tax dollars.
I'm taxed on my actual income though, not something like the whole country's median income. But I can only deduct a crude approximation of the whole country's minimum necessary expenses.
It definitely works against you both ways in high COL areas, where salaries are higher in part bc expenses are higher, but deductions are still fixed.