Based on @CouchDeveloper and your own reply, you can create/add those global function overloads possibly to keep the same ergonomics:
func autoreleasepool<Result>(_ perform: @escaping () async throws -> Result) async throws -> Result {
try await Task {
try await perform()
}.value
}
func autoreleasepool<Result>(_ perform: @escaping () async -> Result) async -> Result {
await Task {
await perform()
}.value
}