The code you’ve got is sensible and a good way of checking initial state to avoid junk data and bad state. It’s not inefficient really.
You don’t know all the user IDs that you’d want to populate up-front, so there’s no point saying “for each user ID, set it to zero by default”, and that would be a waste of time and resources anyway. The ‘Map’ type doesn’t provide a “default value” idea afaik.
You could re-write that block to be a little cleverer but I wouldn’t bother; it does what it means and it means what it says.