Joplin maybe https://joplinapp.org/
This does not support handwriting / free-inking AFAICT but does have a very promising feature set:
* save to local sqlite
* desktop, terminal, mobile app
* E2EE
* Portable app for USBs
* WebDAV sync
* Dropbox, Evernote sync
* File attachments, and if they are images, the images are rendered
I don’t mind paying for Evernote, but its options for backup and export are not impressive.
[Edited/extended]