As you will know, FUNCTIONs in Fortran that are not qualified additionally can possibly have side effects. The onus then lies on the program author and the consumer(s) to deal with the consequences.
FUNCTIONs attributed additionally e.g., PURE / ELEMENTAL , SIMPLE (feature introduced starting Fortran 2023) have particular semantic requirements designed to avoid certain side effects. These start with the INTENT(IN) attribute of function parameters. With this attribute, ALLOCATABLE array dummy arguments are not a concern.