Don't overconstrain the types that can result from transform if optional<T&> is allowed.
https://eel.is/c++draft/optional#monadic-7
Let U be remove_cv_t<invoke_result_t<F, decltype(*val)>>.
https://eel.is/c++draft/optional#monadic-8
Mandates: U is a non-array object type other than in_place_t or nullopt_t. The declaration
U u(invoke(std::forward(f), *val));
is well-formed for some invented variable u.
[Note 1: There is no requirement that U is movable ([dcl.init.general]). — end note]
However, if optional<T&> is allowed, the object type requirement is too strong -- is_object_v<U> will prohibit a reference returning function creating an optional where U is a reference.
Caught by existing test case.