Given two sorted integer arrays arr1 and arr2, write a function that returns a new sorted array containing all elements from both arrays. The input arrays are already sorted in non-decreasing order, and duplicate values should be preserved in the result.
def merge_sorted_arrays(arr1, arr2):