Can I get a bright rear light using AA batteries, or is there a compelling reason why nonreplaceable batteries are so widespread?
Most modern lights use rechargeable lithium ion batteries. Those come in three form factors: Pouch cells, cylindrical cells and coin cells.
Pouch cells come in a lot of different dimensions which gives manufacturers a lot of flexibility when designing the product. They also have cables directly attached and are quite fragile. Good for weight and size but bad for handling by a user.
Cylindrical cells like 18650 have a relatively robust metal shell. Sometimes they are user replaceable but somehow this never caught on. Most of the time they are directly soldered or combined into a battery pack (most older laptop batteries are just a plastic shell and some electronics around 18650 cells).
Coin cells are usually directly soldered to the circuit board. I guess you could make a coin cell holder but that just increases size and weight and introduces another point of failure.
So only the cylindrical cells could really be replaced by a normal end user.
Another factor is charging current and voltage. Lithium ion batteries differ slightly in charging cutoff voltage and charging current. Some can be charged up to 4.3V, others only up to 4.1V. Charging a 4.1V cell up to 4.3V can cause it to go up in flames. So if the device has a built-in charger you’d somehow have to make sure that a cell with the correct charging cutoff voltage is inserted or that the correct voltage is selected. I guess yet another factor is that a battery charge level indicator can be directly integrated into the device’s circuit board instead of being a separate circuit inside the battery. Charge level indicators either estimate the level via battery voltage (which again, varies slightly between LiIon batteries) or by measuring the energy going in and out of the battery (Coulomb counters)
Apart from that there are generally some advantages in not having a hatch and battery holder for user-replaceable batteries.

Less complexity (more robust, cheaper)
Easier to make dust and waterproof
Smaller
Lighter
More flexibility in the case design
Product only lasts about 5 to 10 years. Of course that’s only an advantage for the manufacturer because they can sell you a new one.

There is simply no easy way to make a tiny, water-resistant, 40g light like this with a 420mAh Li-Ion battery and have it user-replaceable: