Given the head of a singly linked list, reverse the list and return the new head.
Implement a function that takes the head node of the list and returns the head node after reversal. The list nodes are defined as:
val: integer value stored in the nodenext: reference to the next node, or Nonedef reverse_linked_list(head):