location: :keep only affect function definitions

This commit changes how metadata is stored once location: :keep
is used and also removes the __scope__ special form.

Closes #1877