I'm leaving this comment so it can be helpful to others who may encounter the same issue later on.
When creating a function in SQL Developer, a common cause of compilation errors can be related to language settings.
Switching from your local language to English can help resolve these compilation issues.
To do this, navigate to your user directory on the C drive and go to:
AppData\Roaming\SQL Developer\<your version>
There, open the product.conf file with Notepad and add the following lines if you're using a local language:
AddVMOption -Duser.language=en
AddVMOption -Duser.country=US
After this step, SQL Developer will launch with the English interface.
Additionally, you should check your language settings under Preferences → Database → NLS.
Once you've done that, you should be able to create your function using CREATE OR REPLACE FUNCTION without any issues.
Kind regards :)