Hi Frode,
You can’t disable timeline and notes control with code, but you can just assign "Read" access of Note entity from security role to disable Notes control in Timeline.
1.Go Settings > Security > Security Roles.

2.Go Settings > Security > Users to choose one user to see which security roles are assigned.

3.select these security roles and set Note entity with only ’Read’ privilege and cancel other privileges(Create, Write, Delete, Assign, Append, Assign to, Append to).

Make sure all security roles that user is assigned have set done.
4.Test
When user (Jeff Hay) login to D365 and open one record, he just read notes that created previously, and he can’t edit these notes or create new notes.

Also, you can directly hide Note control in Timeline.
1.Go Settings > Customizations > customize the system > entities > form to double-click timeline control.

2.Test
All users can’t see Notes in Timelime, they can’t create new notes and read notes that created previously.

Regards,
Leah Ju
Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.