San Diego is considering a “vacancy tax” on apartments and other residential properties that sit empty for long periods, an effort growing in popularity among California cities seeking an array of options for dealing with chronic shortages of affordable housing.