How to programmatically create a node on user registration with the user as author?
In an insert hook the user is already saved and should have an user id. So creating a node and assigning it to the new user as author should be no problem:

/**
 * Implements hook_ENTITY_TYPE_insert() for user entities.
 *
 * Adds a first node for a new user
 */
function mymodule_user_insert(\Drupal\user\UserInterface $user) {
  \Drupal\node\Entity\Node::create([
    'type' =&gt; 'XYZ',
    'title' =&gt; 'First node for user #' . $user-&gt;id(),
    'uid' =&gt; $user-&gt;id(),
  ])-&gt;save();
}