element.py: Fix strong cache key calculation in non-strict mode
The algorithm for calculating the strong cache key should be identical in strict and non-strict mode.
The algorithm for calculating the strong cache key should be identical in strict and non-strict mode.