In the personal profile settings page, there is a entry field for a Twitter handle.
Is it possibel to add custom handles, for example one for Mastodon?
Unsure, but here is the admin documentation for reference.
https://docs.nextcloud.com/server/latest/admin_manual/configuration_user/profile_configuration.html
On wich git repo may one add a issue for adding a flexible socialMedia property for the user profile setting?
It would either be under Contacts or possibly the server repo afaik.
I shared your question to Nextcloud