I know you can use setdefault(key, value) to set default value for a given key, but is there a way to set default values of all keys to some value after creating a dict ?
Not after creating it, no. But you could use a defaultdict in the first place, which sets default values when you initialize it.