Currently, the only way to attach an object is to rez it in world and then have the object call llAttachToAvatar or llAttachToAvatarTemp.
Could we have new functions can directly attach an object from the inventory of the object the script is located in? For example:
llAttachInventoryToAvatar(string inventory, integer attach_point)
llAttachInventoryToAvatarTemp(string inventory, integer attach_point)
The PERMISSION_ATTACH permission will still be required with the destination avatar determined based on the permission - same as how llAttachToAvatar and llAttachToAvatarTemp works today.
Having these new functions improves the main use cases - a store could directly attach a demo product to an avatar without having to first rez it somewhere in the store. A roleplay sim could attach temporary items to players. Vehicle HUDs could be attached when driving. The current 'rez in world first' requirement causes the object to flash in world or require other strange workarounds.
If there are potential security concerns (e.g. guests without rez access trying to cause trouble) then this new functionality could require parcel rez access, even though it wouldn't be directly used.