Given a string, write a function to compute the minimum number of characters that need to be inserted to transform the string into a palindrome.
Implement min_insertions(s) and return an integer. Insertions may occur at any position, and the inserted characters may be chosen freely.
Constraints: 0 <= len(s) <= 2000; s contains lowercase English letters.
def min_insertions(s):