Toggle location for profile when needed
On Android 8 and later location is needed for certain actions in tasker.
For example profile with state WiFi Near cannot be run if location is set to off on device.
Tasker can change location setting between off/device only/battery saving/high accuracy.
As far as I know there really is no way (since profiles cannot be run manually) to create task that enables location for that brief moment some profile requiring it to work needs it.
Suggestion:
Add option to profile preferences to set desired location mode for profiles that need location to be enabled. This way the profile itself would be able to turn on location, do it's thing and turn the location off again. All automatically.
In example profile with State WiFi Near (which would do network check by interval set in Tasker preferences/monitor/WiFi Scan Seconds) could itself turn location mode for example to "Battery Saving" for the time it needs location to scan the nearby networks, and set the mode "off" once we know what networks are available.