In most areas, the building code explicitly requires a window in every bedroom. This serves as an additional emergency exit, either directly on the ground floor or with assistance from firefighters on higher storeys.
[1] BCC Ruling No. 14-03-1366: https://web.archive.org/web/20210422142050/http://www.mah.go...
In Italy a room, any room for residential use, not only needs a window, but the window(s) surface must be at least 1/8 or in some cases 1/12 of the floor surface of that room, a windowless room can only be a bathroom (with a compulsory exhaust fan) or a closet/corridor/storage/utility room.
But this comes not from fire related laws, but rather from minimal health requirements (natural light, ventilation).
As someone that will easily lie in bed to whatever hour, it's very easy to sit around in complete blackness and come outside to realise it's 4pm.