Long answer.
In older programming languages like C a programmer is very aware of what data is and what a pointer (to data). In higher level programming languages like Pyton most of the implementation in bits and bytes keeps hidden to the programmer. Unfortunately the creators of Python did not succeed in keeping all the internal details hidden. And you just hit such a detail where you need to understand what a pointer is.
When you create a list (alista=[]) then in RAM memory is allocated for this list and the address of this memory location is called a pointer. This pointer is then associated with the identifier (alista).
In your program you pass this pointer as a parameter to a function (var1=cool(alista, "J")). In the function the pointer is associated with a new identifier (goodlist). From this point of view it is clearly understandable that any change to the list will affect both identifiers (alista and goodlist). Furtheron you do a new assignment (newlist=goodlist) and again these two identifiers point to the same list.
So to solve this problem your function should start making it's own copy of the list. The easyest way to do this is:
newlist = goodlist[:]
"goodlist[:]" is a slice. On both sides of the colon you can give the range: "from:to". A misssing from means the first element and a missing to means the last element. Because the result of slicing is a new list, this new list is allocated in a new location in memory. After that your function should operate on "newlist".
This whole story goes for mutable objects (like lists and dicts). With immutable objects (like strings and integers) you will not encounter these problems, because when you want to change an immutable object in fact new memory is allocated.
I hope this helps you.