All address spaces on AVR can be freely cast between (they keep the same bit pattern). They just aren't dereferenceable when they're in a different address space as they really do point to a separate address space.
This is supported in avr-gcc: https://godbolt.org/z/9Gfvhnhv9
(It crashes in Clang but that's a separate bug).
it would be better to also check the range, something like