A developer writes a function to log messages, intending for each call to start with a fresh list of tags unless specified. However, they notice that tags from previous calls are persisting. What is the most likely cause of this bug?
```python
def log_message(message, tags=[]):
tags.append('INFO')
print(f"{message}: {tags}")
log_message("System start")
log_message("User login")
```
-
A
The `tags` list was not declared as a global variable.
-
B
The function is a closure, causing it to retain the state of `tags`.
-
C
A mutable object (a list) is used as a default argument, which is evaluated only once when the function is defined.
-
D
The `append` method modifies the list in-place, which is not allowed for function parameters.