A function should always explicitly return a value, even if it is a null value.

When the purpose of a function is to return data then it is reasonable to return either the data on success or a null value on an error - I agree that in this case that returning an error value is unwise.

However, when the function is not expected to return data then it makes sense use the error status as the return value.

Apart from anything else this makes it consistent with the KiXtart built-in functions (e.g. Open() EnumValue()) which use the error state as their exit value.

The code that I posted earlier (repeated here for clarity) does just that:
Code:
Function ChangeVLKey($VOL_PROD_KEY)
Dim $obj, $objects, $result
;Key is without hyphens (ABCDEFGHIJKLMNOPQRSTUVWXY)

$objects = GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("win32_WindowsProductActivation")

If Not @ERROR
For Each $obj in $objects
$result = $obj.SetProductKey($VOL_PROD_KEY)
Next
EndIf
$ChangeVLKey = @error
Exit $ChangeVLKey
EndFunction