Drupal 8: Add menu item with anchor link programmatically in .menu.yml

For a Drupal 8 EU Cookie Compliance patch I needed a way to add an anchor link as default menu item programmatically in .menu.yml

title: "Anchor example"
description: "Scroll to top on the current page"
url: "internal:#top"

See my addition in documentation: https://www.drupal.org/docs/drupal-apis/menu-api/providing-module-define...

Thanks to the comments in https://drupal.stackexchange.com/questions/229376/non-clickable-menu-ite...
and https://drupal.stackexchange.com/questions/280665/how-to-add-a-nolink-me... which helped me a lot to find this solution.