Why doesn't eTaskGetState support NULL parameter?

Is eTaskGetState support NULL parameter or not?
The MPU_eTaskGetStateImpl can pass NULL to eTaskGetState, and eTaskGetState can deal with pxCurrentTCB, but why doesn’t eTaskGetState use prvGetTCBFromHandle to deal with NULL parameter, and instead it use configASSERT( pxTCB ) to refuse NULL parameter?

A task can’t call eTaskGetState() unless it is in the Running state, so passing NULL to obtain the state of the calling task would always return the same value.

Yes, passing NULL to eTaskGetState() should return the same value : eRunning.
But in the code, passing NULL to eTaskGetState() will trigger assert or dereference NULL.

But the conversion of NULL only applies to functions that define they do it.

To define that eTaskGetState does that conversion, means code needs to be present to check it, code that add no real value to the function.

Note, configASSERT might be a null operation in production builds, so can be free.

Yes, the cost is low, but it isn’t zero, and the benefit is slow close to zero as not to be worth it.

Sounds like eTaskGetState is similar with prvTaskIsTaskSuspended, that it doesn’t make sense for a running task to query self status with NULL parameter. Is that correct?
If so, shall we add some comment to clarify this, just like what already did in prvTaskIsTaskSuspended ?

I’d also prefer avoiding (the slightest) overhead for useless functionality.
In addition eTaskGetState clearly documents the API.
Other API docs like … RTOS - vTaskGetInfo() also clearly describe that a NULL task handle is allowed and what it means.
IMHO there is nothing to add.

APIs which allow NULL for the task handle document the same. For example - https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/include/task.h#L1055

eTaskGetState does not allow NULL and therefore, does not document so - https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/include/task.h#L1036

I agree with @hs2 that there is nothing to add here.